clientservice

package
v2.0.0-...-fbac10d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is the error returned when the client service gets a 404 from Harness SaaS
	ErrNotFound = errors.New("ErrNotFound")

	// ErrUnauthorized is the error returned when the client service gets a 401 or 403 from Harness SaaS
	ErrUnauthorized = errors.New("ErrUnauthorized")

	// ErrInternal is the error returned when the client service gets a 500 or unexpected error from Harness SaaS
	ErrInternal = errors.New("ErrInternal")

	// ErrBadRequest is the error returned when the client service gets a 400 from Harness SaaS
	ErrBadRequest = errors.New("bad request")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a type for interacting with the Feature Flag Client Service

func NewClient

func NewClient(l log.Logger, addr string, reg *prometheus.Registry) (Client, error)

NewClient creates a Client

func (Client) Authenticate

func (c Client) Authenticate(ctx context.Context, apiKey string, target domain.Target) (string, error)

Authenticate makes an authentication request to the client service

func (Client) AuthenticateProxyKey

func (c Client) AuthenticateProxyKey(ctx context.Context, key string) (domain.AuthenticateProxyKeyResponse, error)

AuthenticateProxyKey makes an auth request to the ff-client-service's /proxy/auth endpoint

func (Client) FetchFeatureConfigForEnvironment

func (c Client) FetchFeatureConfigForEnvironment(ctx context.Context, authToken, cluster, envID string) ([]clientgen.FeatureConfig, error)

func (Client) FetchSegmentConfigForEnvironment

func (c Client) FetchSegmentConfigForEnvironment(ctx context.Context, authToken, cluster, envID string) ([]clientgen.Segment, error)

func (Client) GetProxyConfig

func (c Client) GetProxyConfig(ctx context.Context, input domain.GetProxyConfigInput) (domain.ProxyConfig, error)

GetProxyConfig makes a /proxy/config request and returns the result.

func (Client) PageProxyConfig

func (c Client) PageProxyConfig(ctx context.Context, input domain.GetProxyConfigInput) ([]domain.ProxyConfig, error)

PageProxyConfig pages over the /proxy/config API until its retrieved all the results

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL