(input *api.GetFunctionInput)
| 70 | } |
| 71 | |
| 72 | func (c *RegistryClient) GetFunction(input *api.GetFunctionInput) (*api.GetFunctionOutput, error) { |
| 73 | req := c.client.Get(). |
| 74 | Resource("functions/" + *input.FunctionName) |
| 75 | req.SetHeader("Host", req.URL().Host) |
| 76 | req.SetHeader(api.HeaderXRequestID, input.RequestID) |
| 77 | |
| 78 | if input.SimpleAuth { |
| 79 | req.SetHeader(api.HeaderXAuthToken, "cfc-auth-2018") |
| 80 | req.SetHeader(api.BceFaasUIDKey, "root") |
| 81 | } |
| 82 | if c.authTransfer && input.Authorization != "" { |
| 83 | req.SetHeader(api.HeaderAuthorization, input.Authorization) |
| 84 | } else { |
| 85 | req.SetHeader(api.HeaderXAccountID, input.AccountID) |
| 86 | req.SetHeader(api.HeaderAuthorization, c.signer.GetSignature(req)) |
| 87 | } |
| 88 | |
| 89 | var out api.GetFunctionOutput |
| 90 | result := req.Do() |
| 91 | err := result.Into(&out) |
| 92 | if err != nil && result.GetStatusCode() == http.StatusNotFound { |
| 93 | finalErr := innerErr.NewResourceNotFoundException("get function from data storer failed", err) |
| 94 | return &out, finalErr |
| 95 | } |
| 96 | return &out, err |
| 97 | } |
| 98 | |
| 99 | func (c *RegistryClient) GetAlias(input *api.GetAliasInput) (*api.GetAliasOutput, error) { |
| 100 | // TODO: not a common api |
nothing calls this directly
no test coverage detected