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

Method GetFunction

pkg/controller/function/function_server.go:52–71  ·  view source on GitHub ↗
(input *api.GetFunctionInput)

Source from the content-addressed store, hash-verified

50}
51
52func (f *functionServerClient) GetFunction(input *api.GetFunctionInput) (output *api.GetFunctionOutput, hitCache bool, err error) {
53 if input.WithCache {
54 v, ok := f.cache.Get(CacheKey(CacheTypeFunction, *input.FunctionName))
55 if ok {
56 output = v.(*api.GetFunctionOutput)
57 hitCache = true
58 logs.Debugf("get function cache %s", *input.FunctionName)
59 return
60 }
61 }
62 output, err = f.rpcClient.GetFunction(input)
63 if err != nil {
64 return
65 }
66
67 if input.WithCache {
68 f.cache.Set(CacheKey(CacheTypeFunction, *input.FunctionName), output, f.cache.CacheExpiration(CacheTypeFunction))
69 }
70 return
71}
72
73func (f *functionServerClient) GetAlias(input *api.GetAliasInput) (output *api.GetAliasOutput, hitCache bool, err error) {
74 if input.WithCache && input.FunctionBrn != "" {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected