Documentation ¶
Index ¶
- Constants
- Variables
- func GetPayload(codename string, entity *core.Entity) core.Payload
- func GetVariation(codename string, entity *core.Entity) string
- func Init(args *InitArgs) error
- func IsEnabled(codename string, entity *core.Entity) bool
- func IsSampled(codename string, entity *core.Entity) bool
- func Publish(entity *core.Entity)
- func SetEntity(entity *core.Entity)
- func Shutdown(timeout time.Duration) bool
- func Track(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(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(entity *core.Entity)
- func (flagger *Flagger) SetEntity(entity *core.Entity)
- func (flagger *Flagger) Shutdown(timeout time.Duration) bool
- func (flagger *Flagger) Track(event *core.Event)
- type InitArgs
Constants ¶
const ( FlaggerAPIKey = "FLAGGER_API_KEY" FlaggerSourceURL = "FLAGGER_SOURCE_URL" FlaggerBackupSourceURL = "FLAGGER_BACKUP_SOURCE_URL" FlaggerSSEUrl = "FLAGGER_SSE_URL" FlaggerIngestionURL = "FLAGGER_INGESTION_URL" FlaggerLogLevel = "FLAGGER_LOG_LEVEL" )
ENV variable constants
Variables ¶
var ( // ErrBadInitArgs represent bad initialization arguments error ErrBadInitArgs = errors.New("bad init arguments") )
var ( // SDKInfo represent meta information SDKInfo = &core.SDKInfo{ Name: "golang", Version: "3.1.0", } )
Functions ¶
func GetPayload ¶
GetPayload return payload for Entity by codename
func GetVariation ¶
GetVariation return variation for Entity by codename
func IsSampled ¶
IsSampled returns whether or not an entity is within one of the targeted populations. However, the entity may or may not be "sampled".
A sampled entity may someday receive this feature, but this function only determines whether entity is sampled.
func SetEntity ¶
SetEntity represent function to storing Entity(default like), that will be use instead if any method have no entity
Types ¶
type Flagger ¶
type Flagger struct {
// contains filtered or unexported fields
}
Flagger represent flagger client implementation
func (*Flagger) GetPayload ¶
GetPayload returns the payload associated with the treatment assigned to the entity
func (*Flagger) GetVariation ¶
GetVariation returns the variation that the entity will receive (after resolving all Flagging Rules). This is a more general flag function that is useful for multivariate flags.
func (*Flagger) Init ¶
Init gets FlaggerConfiguration, establishes and maintains SSE connections and initialize Ingester
func (*Flagger) IsSampled ¶
IsSampled returns whether or not an entity is within one of the targeted populations. However, the entity may or may not be "sampled". A sampled entity may someday receive this feature, but this function only determines whether entity is sampled.
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