Documentation
¶
Index ¶
- Variables
- func ConvertTarget(t Target) evaluation.Target
- type AuthAPIKey
- type AuthConfig
- type AuthRequest
- type AuthResponse
- type Claims
- type EnvironmentHealth
- type EnvironmentID
- type EvaluationsByFeatureRequest
- type EvaluationsRequest
- type FeatureConfig
- type FeatureConfigByIdentifierRequest
- type FeatureConfigRequest
- type FeatureFlag
- type FeatureFlagKey
- type HealthResponse
- type MetricsRequest
- type SDKClientMap
- type Segment
- type SegmentKey
- type StreamRequest
- type StreamResponse
- type StreamState
- type StreamStatus
- type Target
- type TargetKey
- type TargetSegmentsByIdentifierRequest
- type TargetSegmentsRequest
- type Token
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCacheNotFound is the error returned by a cache when there is no value for // a Key/Field ErrCacheNotFound = errors.New("cache: not found") // ErrCacheInternal is the error returned by a cache when there is an unexpected error ErrCacheInternal = errors.New("cache: internal error") )
Functions ¶
func ConvertTarget ¶
func ConvertTarget(t Target) evaluation.Target
ConvertTarget converts types.Target to the evaluation.Target
Types ¶
type AuthAPIKey ¶
type AuthAPIKey string
AuthAPIKey is the APIKey type used for authentication lookups
func NewAuthAPIKey ¶
func NewAuthAPIKey(key string) AuthAPIKey
NewAuthAPIKey creates an AuthAPIKey from a key
type AuthConfig ¶
type AuthConfig struct { APIKey AuthAPIKey EnvironmentID EnvironmentID }
AuthConfig contains a hashed APIKey and the EnvironmentID it belongs to
type AuthRequest ¶
AuthRequest contains the fields sent in an authentication request
type AuthResponse ¶
type AuthResponse struct {
AuthToken string `json:"authToken"`
}
AuthResponse contains the fields returned in an authentication response
type Claims ¶
type Claims struct { Environment string `json:"environment"` ClusterIdentifier string `json:"clusterIdentifier"` jwt.StandardClaims }
Claims are custom jwt claims used by the proxy for generating a jwt token
type EnvironmentHealth ¶
type EnvironmentHealth struct { ID string `json:"id"` StreamStatus StreamStatus `json:"streamStatus"` }
EnvironmentHealth contains the health info for an environment
type EnvironmentID ¶
type EnvironmentID string
EnvironmentID is the environment value we store in the cache
func (*EnvironmentID) MarshalBinary ¶
func (a *EnvironmentID) MarshalBinary() ([]byte, error)
MarshalBinary marshals an EnvironmentID to bytes. Currently it uses json marshaling but if we want to optimise storage space we could use something more efficient
func (*EnvironmentID) UnmarshalBinary ¶
func (a *EnvironmentID) UnmarshalBinary(b []byte) error
UnmarshalBinary unmarshals bytes to an EnvironmentID
type EvaluationsByFeatureRequest ¶
type EvaluationsByFeatureRequest struct { EnvironmentID string TargetIdentifier string FeatureIdentifier string }
EvaluationsByFeatureRequest contains the fields sent in a GET /client/env/{environmentUUID}/target/{target}/evaluations/{feature} request
type EvaluationsRequest ¶
EvaluationsRequest contains the fields sent in a GET /client/env/{environmentUUID}/target/{target}/evaluations
type FeatureConfig ¶
type FeatureConfig struct {
FeatureFlag
}
FeatureConfig is the type containing FeatureConfig information and is what we return from /GET client/env/<env>/feature-configs
type FeatureConfigByIdentifierRequest ¶
FeatureConfigByIdentifierRequest contains the fields sent in a GET /client/env/{environmentUUID}/feature-configs/{identifier}
type FeatureConfigRequest ¶
type FeatureConfigRequest struct {
EnvironmentID string
}
FeatureConfigRequest contains the fields sent in a GET /client/env/{environmentUUID}/feature-configs
type FeatureFlag ¶
type FeatureFlag rest.FeatureConfig
FeatureFlag stores feature flag data
func (*FeatureFlag) MarshalBinary ¶
func (f *FeatureFlag) MarshalBinary() ([]byte, error)
MarshalBinary marshals a FeatureFlag to bytes. Currently it just uses json marshaling but if we want to optimise storage space we could use something more efficient
func (*FeatureFlag) UnmarshalBinary ¶
func (f *FeatureFlag) UnmarshalBinary(b []byte) error
UnmarshalBinary unmarshals bytes to a FeatureFlag
type FeatureFlagKey ¶
type FeatureFlagKey string
FeatureFlagKey is the key that maps to a FeatureConfig
func NewFeatureConfigKey ¶
func NewFeatureConfigKey(envID string, identifier string) FeatureFlagKey
NewFeatureConfigKey creates a FeatureFlagKey from an environment and identifier
func NewFeatureConfigsKey ¶
func NewFeatureConfigsKey(envID string) FeatureFlagKey
NewFeatureConfigsKey creates a FeatureFlagKey from and environmet
type HealthResponse ¶
type HealthResponse struct { Environments []EnvironmentHealth `json:"environments"` CacheStatus string `json:"cacheStatus"` }
HealthResponse contains the fields returned in a healthcheck response
type MetricsRequest ¶
MetricsRequest contains the fields sent in a POST /metrics request
type SDKClientMap ¶
SDKClientMap is a map of environmentIDs to sdks
func (*SDKClientMap) Copy ¶
func (s *SDKClientMap) Copy() map[string]*harness.CfClient
Copy returns a copy of the map
func (*SDKClientMap) Set ¶
func (s *SDKClientMap) Set(key string, value *harness.CfClient)
Set sets a key and value in the map
func (*SDKClientMap) StreamConnected ¶
func (s *SDKClientMap) StreamConnected(key string) bool
StreamConnected checks if the sdk for the given key has a healthy stream connection. If an SDK doesn't exist for the key it will return false
type Segment ¶
Segment is a rest.Segment that we can declare methods on
func (*Segment) MarshalBinary ¶
MarshalBinary marshals a Segment to bytes. Currently it uses json marshaling but if we want to optimise storage space we could use something more efficient
func (*Segment) UnmarshalBinary ¶
UnmarshalBinary unmarshals bytes to a Segment
type SegmentKey ¶
type SegmentKey string
SegmentKey is the key that maps to a Segment
func NewSegmentKey ¶
func NewSegmentKey(envID string, identifier string) SegmentKey
NewSegmentKey creates a SegmentKey from an environment and identifier
func NewSegmentsKey ¶
func NewSegmentsKey(envID string) SegmentKey
NewSegmentsKey creates a SegmentKey from an environment
type StreamRequest ¶
type StreamRequest struct {
APIKey string `json:"api_key"`
}
StreamRequest contains the fields sent in a GET /stream request
type StreamResponse ¶
type StreamResponse struct {
GripChannel string
}
StreamResponse contains the fields returned by a Stream request
type StreamState ¶
type StreamState string
StreamState is the connection state for a stream
const ( // StreamStateConnected is the status for when a stream is connected StreamStateConnected StreamState = "CONNECTED" // StreamStateDisconnected is the status for when a stream is disconnected StreamStateDisconnected StreamState = "DISCONNECTED" // StreamStateInitializing is the status for when the stream is initialising StreamStateInitializing StreamState = "INITIALIZING" )
type StreamStatus ¶
type StreamStatus struct { State StreamState `json:"state"` Since int64 `json:"since"` }
StreamStatus contains a streams state
type Target ¶
Target is a admingen.Target that we can declare methods on
func (*Target) MarshalBinary ¶
MarshalBinary marshals a Target to bytes. Currently it uses json marshaling but if we want to optimise storage space we could use something more efficient
func (*Target) UnmarshalBinary ¶
UnmarshalBinary unmarshals bytes to a Target
type TargetKey ¶
type TargetKey string
TargetKey is the key that maps to a Target
func NewTargetKey ¶
NewTargetKey creates a TargetKey from an environment and identifier
func NewTargetsKey ¶
NewTargetsKey creates a TargetKey from an environment
type TargetSegmentsByIdentifierRequest ¶
TargetSegmentsByIdentifierRequest contains the fields sent in a GET /client/env/{environmentUUID}/target-segments/{identifier}
type TargetSegmentsRequest ¶
type TargetSegmentsRequest struct {
EnvironmentID string
}
TargetSegmentsRequest contains the fields sent in a GET /client/env/{environmentUUID}/target-segments
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Token is a type that contains a generated token string and the claims
func (Token) TokenString ¶
TokenString returns the auth token string