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

Method GetAlias

pkg/controller/function/function_server.go:73–92  ·  view source on GitHub ↗
(input *api.GetAliasInput)

Source from the content-addressed store, hash-verified

71}
72
73func (f *functionServerClient) GetAlias(input *api.GetAliasInput) (output *api.GetAliasOutput, hitCache bool, err error) {
74 if input.WithCache && input.FunctionBrn != "" {
75 v, ok := f.cache.Get(CacheKey(CacheTypeAlias, input.FunctionBrn))
76 if ok {
77 output = v.(*api.GetAliasOutput)
78 hitCache = true
79 logs.Debugf("get function cache %s", input.FunctionBrn)
80 return
81 }
82 }
83 output, err = f.rpcClient.GetAlias(input)
84 if err != nil {
85 return
86 }
87
88 if input.WithCache && input.FunctionBrn != "" {
89 f.cache.Set(CacheKey(CacheTypeAlias, input.FunctionBrn), output, f.cache.CacheExpiration(CacheTypeAlias))
90 }
91 return
92}
93
94func (f *functionServerClient) GetRuntimeConfiguration(input *api.GetRuntimeConfigurationInput) (conf *api.RuntimeConfiguration, hitCache bool, err error) {
95 v, ok := f.cache.Get(CacheKey(CacheTypeRuntime, input.RuntimeName))

Callers

nothing calls this directly

Calls 6

DebugfFunction · 0.92
CacheKeyFunction · 0.85
CacheExpirationMethod · 0.80
GetMethod · 0.65
GetAliasMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected