prefab

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ResolutionResultTypeSuccess resolutionResultType = iota
	ResolutionResultTypeError
)
View Source
const (
	SUCCESS awaitInitializationResult = iota
	TIMEOUT
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(opts ...Option) (*Client, error)

func (*Client) FeatureIsOn

func (c *Client) FeatureIsOn(key string, contextSet ContextSet) (bool, bool)

func (*Client) GetBoolValue

func (c *Client) GetBoolValue(key string, contextSet ContextSet) (bool, bool, error)

func (*Client) GetBoolValueWithDefault

func (c *Client) GetBoolValueWithDefault(key string, contextSet ContextSet, defaultValue bool) (bool, bool)

func (*Client) GetDurationValue

func (c *Client) GetDurationValue(key string, contextSet ContextSet) (time.Duration, bool, error)

func (*Client) GetDurationWithDefault

func (c *Client) GetDurationWithDefault(key string, contextSet ContextSet, defaultValue time.Duration) (time.Duration, bool)

func (*Client) GetFloatValue

func (c *Client) GetFloatValue(key string, contextSet ContextSet) (float64, bool, error)

func (*Client) GetFloatValueWithDefault

func (c *Client) GetFloatValueWithDefault(key string, contextSet ContextSet, defaultValue float64) (float64, bool)

func (*Client) GetIntValue

func (c *Client) GetIntValue(key string, contextSet ContextSet) (int64, bool, error)

func (*Client) GetIntValueWithDefault

func (c *Client) GetIntValueWithDefault(key string, contextSet ContextSet, defaultValue int64) (int64, bool)

func (*Client) GetJSONValue

func (c *Client) GetJSONValue(key string, contextSet ContextSet) (interface{}, bool, error)

func (*Client) GetJSONValueWithDefault

func (c *Client) GetJSONValueWithDefault(key string, contextSet ContextSet, defaultValue interface{}) (interface{}, bool)

func (*Client) GetLogLevelStringValue

func (c *Client) GetLogLevelStringValue(key string, contextSet ContextSet) (string, bool, error)

func (*Client) GetStringSliceValue

func (c *Client) GetStringSliceValue(key string, contextSet ContextSet) ([]string, bool, error)

func (*Client) GetStringSliceValueWithDefault

func (c *Client) GetStringSliceValueWithDefault(key string, contextSet ContextSet, defaultValue []string) ([]string, bool)

func (*Client) GetStringValue

func (c *Client) GetStringValue(key string, contextSet ContextSet) (string, bool, error)

func (*Client) GetStringValueWithDefault

func (c *Client) GetStringValueWithDefault(key string, contextSet ContextSet, defaultValue string) (string, bool)

func (*Client) WithContext

func (c *Client) WithContext(contextSet *ContextSet) *boundClient

type ClientInterface

type ClientInterface interface {
	GetIntValue(key string, contextSet ContextSet) (int64, bool, error)
	GetBoolValue(key string, contextSet ContextSet) (bool, bool, error)
	GetStringValue(key string, contextSet ContextSet) (string, bool, error)
	GetFloatValue(key string, contextSet ContextSet) (float64, bool, error)
	GetStringSliceValue(key string, contextSet ContextSet) ([]string, bool, error)
	GetDurationValue(key string, contextSet ContextSet) (time.Duration, bool, error)
	GetIntValueWithDefault(key string, contextSet ContextSet, defaultValue int64) (int64, bool)
	GetBoolValueWithDefault(key string, contextSet ContextSet, defaultValue bool) (bool, bool)
	GetStringValueWithDefault(key string, contextSet ContextSet, defaultValue string) (string, bool)
	GetFloatValueWithDefault(key string, contextSet ContextSet, defaultValue float64) (float64, bool)
	GetStringSliceValueWithDefault(key string, contextSet ContextSet, defaultValue []string) ([]string, bool)
	GetDurationWithDefault(key string, contextSet ContextSet, defaultValue time.Duration) (time.Duration, bool)
	GetLogLevelStringValue(key string, contextSet ContextSet) (string, bool, error)
	GetJSONValue(key string, contextSet ContextSet) (interface{}, bool, error)
	GetJSONValueWithDefault(key string, contextSet ContextSet, defaultValue interface{}) (interface{}, bool)
	FeatureIsOn(key string, contextSet ContextSet) (bool, bool)
	WithContext(contextSet *ContextSet) *boundClient
}

type ContextSet

type ContextSet = contexts.ContextSet

type Option

type Option func(*options.Options) error

func WithAPIKey

func WithAPIKey(apiKey string) Option

func WithAPIURL

func WithAPIURL(apiURL string) Option

func WithConfigDirectory

func WithConfigDirectory(configDirectory string) Option

func WithConfigOverrideDirectory

func WithConfigOverrideDirectory(configOverrideDirectory string) Option

func WithDatasource

func WithDatasource(datasource options.Datasource) Option

func WithEnvironmentNames

func WithEnvironmentNames(environmentNames []string) Option

func WithGlobalContext

func WithGlobalContext(globalContext *ContextSet) Option

func WithInitializationTimeoutSeconds

func WithInitializationTimeoutSeconds(timeoutSeconds float64) Option

func WithOnInitializationFailure

func WithOnInitializationFailure(onInitializationFailure options.OnInitializationFailure) Option

type Options

type Options = options.Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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