runtime

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFile added in v0.5.0

func NewFile(config SourceConfig, logger *logger.Logger) *file.Sync

func NewGRPC added in v0.5.0

func NewGRPC(config SourceConfig, logger *logger.Logger) *grpc.Sync

func NewHTTP added in v0.5.0

func NewHTTP(config SourceConfig, logger *logger.Logger) *httpSync.Sync

func NewK8s added in v0.5.0

func NewK8s(uri string, logger *logger.Logger) (*kubernetes.Sync, error)

Types

type Config

type Config struct {
	MetricExporter    string
	ManagementPort    uint16
	OtelCollectorURI  string
	ServiceCertPath   string
	ServiceKeyPath    string
	ServicePort       uint16
	ServiceSocketPath string

	SyncProviders []SourceConfig
	CORS          []string
}

Config is the configuration structure derived from startup arguments.

type Runtime

type Runtime struct {
	Evaluator     eval.IEvaluator
	Logger        *logger.Logger
	Service       service.IFlagEvaluationService
	ServiceConfig service.Configuration
	SyncImpl      []sync.ISync
	// contains filtered or unexported fields
}

func FromConfig

func FromConfig(logger *logger.Logger, version string, config Config) (*Runtime, error)

FromConfig builds a runtime from startup configurations nolint: funlen

func (*Runtime) Start

func (r *Runtime) Start() error

type SourceConfig added in v0.5.0

type SourceConfig struct {
	URI      string `json:"uri"`
	Provider string `json:"provider"`

	BearerToken string `json:"bearerToken,omitempty"`
	CertPath    string `json:"certPath,omitempty"`
	TLS         bool   `json:"tls,omitempty"`
	ProviderID  string `json:"providerID,omitempty"`
	Selector    string `json:"selector,omitempty"`
	Interval    uint32 `json:"interval,omitempty"`
}

SourceConfig is configuration option for flagd. This maps to startup parameter sources

func ParseSources added in v0.5.0

func ParseSources(sourcesFlag string) ([]SourceConfig, error)

ParseSources parse a json formatted SourceConfig array string and performs validations on the content

func ParseSyncProviderURIs added in v0.5.0

func ParseSyncProviderURIs(uris []string) ([]SourceConfig, error)

ParseSyncProviderURIs uri flag based sync sources to SourceConfig array. Replaces uri prefixes where necessary to derive SourceConfig

Jump to

Keyboard shortcuts

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