Documentation ¶
Index ¶
- Constants
- func DefaultHTTPClient() *http.Client
- type Cache
- func (c *Cache) GetBool(flag string, evalCtx of.FlattenedContext) (*of.BoolResolutionDetail, error)
- func (c *Cache) GetFloat(flag string, evalCtx of.FlattenedContext) (*of.FloatResolutionDetail, error)
- func (c *Cache) GetInt(flag string, evalCtx of.FlattenedContext) (*of.IntResolutionDetail, error)
- func (c *Cache) GetInterface(flag string, evalCtx of.FlattenedContext) (*of.InterfaceResolutionDetail, error)
- func (c *Cache) GetString(flag string, evalCtx of.FlattenedContext) (*of.StringResolutionDetail, error)
- func (c *Cache) Purge()
- func (c *Cache) Set(flag string, evalCtx of.FlattenedContext, value interface{}) error
- type ConfigurationChangeStatus
- type DataCollectorManager
- type GoFeatureFlagAPI
- type GoFeatureFlagApiOptions
Constants ¶
const ApplicationJson = "application/json"
const AuthorizationHeader = "Authorization"
const BearerPrefix = "Bearer "
const ContentTypeHeader = "Content-Type"
const IfNoneMatchHeader = "If-None-Match"
Variables ¶
This section is empty.
Functions ¶
func DefaultHTTPClient ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) GetBool ¶
func (c *Cache) GetBool(flag string, evalCtx of.FlattenedContext) (*of.BoolResolutionDetail, error)
GetBool returns the boolean value of the flag from the cache.
func (*Cache) GetFloat ¶
func (c *Cache) GetFloat(flag string, evalCtx of.FlattenedContext) (*of.FloatResolutionDetail, error)
GetFloat returns the float value of the flag from the cache.
func (*Cache) GetInt ¶
func (c *Cache) GetInt(flag string, evalCtx of.FlattenedContext) (*of.IntResolutionDetail, error)
GetInt returns the int value of the flag from the cache.
func (*Cache) GetInterface ¶
func (c *Cache) GetInterface(flag string, evalCtx of.FlattenedContext) (*of.InterfaceResolutionDetail, error)
GetInterface returns the interface value of the flag from the cache.
func (*Cache) GetString ¶
func (c *Cache) GetString(flag string, evalCtx of.FlattenedContext) (*of.StringResolutionDetail, error)
GetString returns the string value of the flag from the cache.
type ConfigurationChangeStatus ¶
type ConfigurationChangeStatus = string
const ( FlagConfigurationInitialized ConfigurationChangeStatus = "FLAG_CONFIGURATION_INITIALIZED" FlagConfigurationUpdated ConfigurationChangeStatus = "FLAG_CONFIGURATION_UPDATED" FlagConfigurationNotChanged ConfigurationChangeStatus = "FLAG_CONFIGURATION_NOT_CHANGED" ErrorConfigurationChange ConfigurationChangeStatus = "ERROR_CONFIGURATION_CHANGE" )
type DataCollectorManager ¶
type DataCollectorManager struct {
// contains filtered or unexported fields
}
DataCollectorManager is a manager for the GO Feature Flag data collector
func NewDataCollectorManager ¶
func NewDataCollectorManager( goffAPI GoFeatureFlagAPI, dataCollectorMaxEventStored int64, collectInterval time.Duration) DataCollectorManager
NewDataCollectorManager creates a new data collector manager
func (*DataCollectorManager) AddEvent ¶
func (d *DataCollectorManager) AddEvent(event model.FeatureEvent) error
AddEvent adds an event to the data collector manager If the number of events in the queue is greater than the maxItem, the event will be skipped
func (*DataCollectorManager) SendData ¶
func (d *DataCollectorManager) SendData() error
SendData sends the data to the data collector
func (*DataCollectorManager) Start ¶
func (d *DataCollectorManager) Start()
func (*DataCollectorManager) Stop ¶
func (d *DataCollectorManager) Stop()
type GoFeatureFlagAPI ¶
type GoFeatureFlagAPI struct {
// contains filtered or unexported fields
}
func NewGoFeatureFlagAPI ¶
func NewGoFeatureFlagAPI(options GoFeatureFlagApiOptions) GoFeatureFlagAPI
func (*GoFeatureFlagAPI) CollectData ¶
func (g *GoFeatureFlagAPI) CollectData(events []model.FeatureEvent) error
func (*GoFeatureFlagAPI) ConfigurationHasChanged ¶
func (g *GoFeatureFlagAPI) ConfigurationHasChanged() (ConfigurationChangeStatus, error)
ConfigurationHasChanged checks if the configuration has changed since the last call.
type GoFeatureFlagApiOptions ¶
type GoFeatureFlagApiOptions struct { // Endpoint contains the DNS of your GO Feature Flag relay proxy (ex: http://localhost:1031) Endpoint string // HTTPClient (optional) is the HTTP Client we will use to contact GO Feature Flag. // By default, we are using a custom HTTPClient with a timeout configure to 10000 milliseconds. HTTPClient *http.Client // APIKey (optional) If the relay proxy is configured to authenticate the requests, you should provide // an API Key to the provider. Please ask the administrator of the relay proxy to provide an API Key. // (This feature is available only if you are using GO Feature Flag relay proxy v1.7.0 or above) // Default: null APIKey string // ExporterMetadata (optional) If we set metadata, it will be sent with every data collection requests along with the events. ExporterMetadata map[string]interface{} }