Documentation ¶
Overview ¶
Package api defines the HTTP interface for the remote config backend
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // descriptive as possible (while not leaking data) to make RC onboarding easier ErrUnauthorized = fmt.Errorf("unauthorized. Please make sure your API key is valid and has the Remote Config scope") // ErrProxy is the error that will be logged if we suspect that there is a wrong proxy setup for remote-config. // It is displayed for any 4XX status code except 401 ErrProxy = fmt.Errorf( "4XX status code. This might be related to the proxy settings. " + "Please make sure the agent can reach Remote Configuration with the proxy setup", ) )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { Fetch(context.Context, *pbgo.LatestConfigsRequest) (*pbgo.LatestConfigsResponse, error) FetchOrgData(context.Context) (*pbgo.OrgDataResponse, error) FetchOrgStatus(context.Context) (*pbgo.OrgStatusResponse, error) }
API is the interface to implement for a configuration fetcher
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient fetches configurations using HTTP requests
func NewHTTPClient ¶
NewHTTPClient returns a new HTTP configuration client
func (*HTTPClient) Fetch ¶
func (c *HTTPClient) Fetch(ctx context.Context, request *pbgo.LatestConfigsRequest) (*pbgo.LatestConfigsResponse, error)
Fetch remote configuration
func (*HTTPClient) FetchOrgData ¶
func (c *HTTPClient) FetchOrgData(ctx context.Context) (*pbgo.OrgDataResponse, error)
FetchOrgData org data
func (*HTTPClient) FetchOrgStatus ¶
func (c *HTTPClient) FetchOrgStatus(ctx context.Context) (*pbgo.OrgStatusResponse, error)
FetchOrgStatus returns the org and key status
Click to show internal directories.
Click to hide internal directories.