Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidTreatmentAllocation = errors.New("invalid treatment allocation")
View Source
var FeatureOff = TreatmentAssignment{}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FetchFeature ¶
func (*Client) GetTreatment ¶
type Feature ¶
type Feature struct { App string `json:"app"` Name string `json:"name"` Allocations []FeatureAllocation `json:"allocations"` }
func NewFeature ¶
func NewFeature(app string, name string, allocations []FeatureAllocation) Feature
func (*Feature) TotalAllocationWeight ¶
type FeatureAllocation ¶
func NewFeatureAllocation ¶
func NewFeatureAllocation(treatment string, weight uint32) FeatureAllocation
type FeatureLab ¶
type FeatureLab interface { GetTreatment(app string, featureName string, criteria string) (TreatmentAssignment, *Error) FetchFeatures(app string) ([]Feature, *Error) FetchFeature(app string, featureName string) (Feature, *Error) }
func NewFeatureLabClient ¶
func NewFeatureLabClient(featureLabHost string) FeatureLab
NewFeatureLabClient creates an instance of FeatureLab which can make calls to the Feature Lab backend service.
func NewFeatureLabDaemonClient ¶
func NewFeatureLabDaemonClient(port uint, apps ...string) (FeatureLab, *grpc.ClientConn, error)
type FeatureLabClient ¶
type FeatureLabClient struct {
// contains filtered or unexported fields
}
func (*FeatureLabClient) FetchFeature ¶
func (f *FeatureLabClient) FetchFeature(app string, featureName string) (Feature, *Error)
FetchFeature fetches the Feature information of a Feature from the Feature Lab backend service.
func (*FeatureLabClient) FetchFeatures ¶
func (f *FeatureLabClient) FetchFeatures(app string) ([]Feature, *Error)
FetchFeatures fetches all features from the Feature Lab backend service.
func (*FeatureLabClient) GetTreatment ¶
func (f *FeatureLabClient) GetTreatment(app string, featureName string, criteria string) (TreatmentAssignment, *Error)
GetTreatment fetches the treatment that is assigned for a criteria in a particular Feature.
type FeatureLabDaemonClient ¶
type FeatureLabDaemonClient struct {
// contains filtered or unexported fields
}
func (*FeatureLabDaemonClient) FetchFeature ¶
func (f *FeatureLabDaemonClient) FetchFeature(app string, featureName string) (Feature, *Error)
FetchFeature fetches the Feature information of a Feature from the Feature Lab backend service.
func (*FeatureLabDaemonClient) FetchFeatures ¶
func (f *FeatureLabDaemonClient) FetchFeatures(app string) ([]Feature, *Error)
FetchFeatures fetches all features from the Feature Lab backend service.
func (*FeatureLabDaemonClient) GetTreatment ¶
func (f *FeatureLabDaemonClient) GetTreatment(app string, featureName string, criteria string) (TreatmentAssignment, *Error)
GetTreatment fetches the treatment that is assigned for a criteria in a particular Feature.
type TreatmentAssigner ¶
type TreatmentAssigner struct { }
func NewTreatmentAssigner ¶
func NewTreatmentAssigner() TreatmentAssigner
func (*TreatmentAssigner) GetTreatmentAssignment ¶
func (ta *TreatmentAssigner) GetTreatmentAssignment(feature Feature, criteria string) (TreatmentAssignment, error)
type TreatmentAssignment ¶
type TreatmentAssignment struct {
Treatment string `json:"treatment"`
}
Click to show internal directories.
Click to hide internal directories.