MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / parseBrn

Function parseBrn

pkg/controller/invoke.go:99–114  ·  view source on GitHub ↗
(ctx *InvokeContext)

Source from the content-addressed store, hash-verified

97}
98
99func parseBrn(ctx *InvokeContext) (brn.BRN, error) {
100 if functionBRN, err := brn.Parse(ctx.FunctionBRN); err != nil {
101 return functionBRN, err
102 } else {
103 ctx.CallerUser = &api.User{
104 ID: functionBRN.AccountID,
105 }
106 resources := strings.Split(functionBRN.Resource, ":")
107 // eg: function:hello-tmp:$LATEST
108 if len(resources) == 3 {
109 ctx.FunctionName = resources[1]
110 ctx.Qualifier = resources[2]
111 }
112 return functionBRN, nil
113 }
114}
115
116func (controller *Controller) getFunction(ctx *InvokeContext) (hitCache bool, err error) {
117 if ctx.RunOptions.RecommendedOptions.Features.EnableMetrics {

Callers 2

TestParseBrnFunction · 0.85

Calls 1

ParseFunction · 0.92

Tested by 1

TestParseBrnFunction · 0.68