Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultUserID = newDefaultUserID()
Functions ¶
Types ¶
type Client ¶
type Client interface {
// BoolVariation fetches variation whose type is boolean using specified feature ID.
// Default value is used when an error occurs. A tracker can be used to track metrics which associates with the variation.
BoolVariation(ctx context.Context, featureID string, def bool) (bool, Tracker)
// Int64Variation fetches variation whose type is int64 using specified feature ID.
// Default value is used when an error occurs. A tracker can be used to track metrics which associates with the variation.
Int64Variation(ctx context.Context, featureID string, def int64) (int64, Tracker)
// Float64Variation fetches variation whose type is float64 using specified feature ID.
// Default value is used when an error occurs. A tracker can be used to track metrics which associates with the variation.
Float64Variation(ctx context.Context, featureID string, def float64) (float64, Tracker)
// StringVariation fetches variation whose type is string using specified feature ID.
// Default value is used when an error occurs. A tracker can be used to track metrics which associates with the variation.
StringVariation(ctx context.Context, featureID string, def string) (string, Tracker)
// JSONVariation fetches variation using specified feature ID and marshals to destination.
// A tracker can be used to track metrics which associates with the variation.
JSONVariation(ctx context.Context, featureID string, dst interface{}) Tracker
Close()
}
Client is bucketeer API client.
type Config ¶
type Config struct {
Log func(error) // Log is a function which is called when the function is not nil and an error occurs.
Host Host // Host is bucketeer api host name.
APIKey APIKey // APIKey is bucketeer api key.
Tag Tag // Tag is specified in fetching variations.
EventFlushInterval time.Duration // EventFlushInterval is an interval to flush events. Default: 1s
EventBufferSize int // EventBufferSize is a buffer size of events channel as queue. Default: 65536
}
Config is a configuration of bucketeer client.
Click to show internal directories.
Click to hide internal directories.