controller

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ApplicationJson = "application/json"
View Source
const AuthorizationHeader = "Authorization"
View Source
const BearerPrefix = "Bearer "
View Source
const ContentTypeHeader = "Content-Type"
View Source
const IfNoneMatchHeader = "If-None-Match"

Variables

This section is empty.

Functions

func DefaultHTTPClient

func DefaultHTTPClient() *http.Client

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(cacheSize int, ttl time.Duration, disabled bool) *Cache

NewCache creates a new cache with the given options.

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.

func (*Cache) Purge

func (c *Cache) Purge()

func (*Cache) Set

func (c *Cache) Set(flag string, evalCtx of.FlattenedContext, value interface{}) error

Set sets the value of the flag in 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{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL