Documentation
¶
Index ¶
- func IsClientError(err error) bool
- func IsForbidden(err error) bool
- func IsServerError(err error) bool
- func IsUnauthorized(err error) bool
- type CacheOptions
- type CachingClient
- func (c *CachingClient) GetAgentInfo(ctx context.Context, agentMeta *api.AgentMeta) (*api.AgentInfo, error)
- func (c *CachingClient) GetProjectInfo(ctx context.Context, agentMeta *api.AgentMeta, projectId string) (*api.ProjectInfo, error)
- func (c *CachingClient) Run(ctx context.Context)
- func (c *CachingClient) SendUsage(ctx context.Context, data *UsageData) error
- type Client
- type ClientError
- type ClientInterface
- type ClientOption
- type ErrorKind
- type HTTPClient
- type UsageData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsClientError ¶ added in v0.0.7
func IsForbidden ¶
func IsServerError ¶ added in v0.0.7
func IsUnauthorized ¶ added in v0.0.7
Types ¶
type CacheOptions ¶
CacheOptions holds cache behaviour configuration.
type CachingClient ¶
type CachingClient struct {
// contains filtered or unexported fields
}
CachingClient wraps ClientInterface to add caching.
func NewCachingClient ¶
func NewCachingClient(client ClientInterface, agentInfoCacheOptions CacheOptions, projectInfoCacheOptions CacheOptions) *CachingClient
func (*CachingClient) GetAgentInfo ¶
func (*CachingClient) GetProjectInfo ¶
func (c *CachingClient) GetProjectInfo(ctx context.Context, agentMeta *api.AgentMeta, projectId string) (*api.ProjectInfo, error)
func (*CachingClient) Run ¶
func (c *CachingClient) Run(ctx context.Context)
type Client ¶
type Client struct { Backend *url.URL HTTPClient HTTPClient AuthSecret []byte UserAgent string }
func (*Client) GetAgentInfo ¶
func (*Client) GetProjectInfo ¶
type ClientError ¶
func (*ClientError) Error ¶
func (c *ClientError) Error() string
type ClientInterface ¶
type ClientOption ¶ added in v0.0.7
type ClientOption func(*clientConfig)
ClientOption to configure the client.
func WithCorrelationClientName ¶ added in v0.0.7
func WithCorrelationClientName(clientName string) ClientOption
WithCorrelationClientName configures the X-GitLab-Client-Name header on the http client.
func WithLogger ¶ added in v0.0.7
func WithLogger(log *zap.Logger) ClientOption
WithLogger sets the log to use.
func WithTracer ¶ added in v0.0.7
func WithTracer(tracer opentracing.Tracer) ClientOption
WithTracer sets a custom tracer to be used, otherwise the opentracing.GlobalTracer is used.
func WithUserAgent ¶ added in v0.0.7
func WithUserAgent(userAgent string) ClientOption
WithUserAgent configures the User-Agent header on the http client.
Click to show internal directories.
Click to hide internal directories.