(input *api.GetFunctionInput)
| 50 | } |
| 51 | |
| 52 | func (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 | |
| 73 | func (f *functionServerClient) GetAlias(input *api.GetAliasInput) (output *api.GetAliasOutput, hitCache bool, err error) { |
| 74 | if input.WithCache && input.FunctionBrn != "" { |
nothing calls this directly
no test coverage detected