Documentation ¶
Index ¶
- Variables
- func GetPayload(codename string, entity *core.Entity) core.Payload
- func GetVariation(codename string, entity *core.Entity) string
- func Init(ctx context.Context, args *InitArgs) error
- func IsEnabled(codename string, entity *core.Entity) bool
- func IsSampled(codename string, entity *core.Entity) bool
- func Publish(ctx context.Context, entity *core.Entity)
- func SetEntity(entity *core.Entity)
- func Shutdown(timeout time.Duration) bool
- func Track(ctx context.Context, event *core.Event)
- type Flagger
- func (flagger *Flagger) GetPayload(codename string, entity *core.Entity) core.Payload
- func (flagger *Flagger) GetVariation(codename string, entity *core.Entity) string
- func (flagger *Flagger) Init(ctx context.Context, args *InitArgs) error
- func (flagger *Flagger) IsEnabled(codename string, entity *core.Entity) bool
- func (flagger *Flagger) IsSampled(codename string, entity *core.Entity) bool
- func (flagger *Flagger) Publish(ctx context.Context, entity *core.Entity)
- func (flagger *Flagger) SetEntity(entity *core.Entity)
- func (flagger *Flagger) Shutdown(timeout time.Duration) bool
- func (flagger *Flagger) Track(ctx context.Context, event *core.Event)
- type InitArgs
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBadInitArgs represent bad initialization arguments error ErrBadInitArgs = errors.New("bad init arguments") )
var ( // SDKInfo represent meta information. do not modify this! SDKInfo = &core.SDKInfo{ Name: "golang", Version: "3.0.0", } )
Functions ¶
func GetPayload ¶
GetPayload return payload for Entity by codename
func GetVariation ¶
GetVariation return variation for Entity by codename
Types ¶
type Flagger ¶
type Flagger struct {
// contains filtered or unexported fields
}
Flagger represent flagger client implementation
func (*Flagger) GetPayload ¶
Returns the payload associated with the treatment assigned to the entity
func (*Flagger) GetVariation ¶
Returns the variation assigned to the entity in a multivariate flag
func (*Flagger) Init ¶
Init gets FlaggerConfiguration, establishes and maintains SSE connections and initialize Ingester
func (*Flagger) SetEntity ¶
SetEntity stores an entity in Flagger, which allows omission of entity in other API methods.
If you don't provide __any__ entity to Flagger: - flag functions always resolve with the default variation - Track method doesn't record an event
Rule of thumb: make sure you provided an entity to the Flagger