memory

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigNotFound       error = fmt.Errorf("config not found")
	ErrCycleDependentConfig error = fmt.Errorf("cycle in config dependency")
)

Functions

This section is empty.

Types

type RootConfigRepoMetadata added in v0.2.1

type RootConfigRepoMetadata struct {
	// This version refers to the version of the metadata.
	Version          string   `json:"version,omitempty" yaml:"version,omitempty"`
	Namespaces       []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
	ProtoDirectory   string   `json:"protoDir,omitempty" yaml:"protoDir,omitempty"`
	UseExternalTypes bool     `json:"externalTypes,omitempty" yaml:"externalTypes,omitempty"`
}

type Store

type Store interface {
	Evaluate(key string, namespace string, lekkoContext map[string]interface{}, dest proto.Message) error
	Close(ctx context.Context) error
}

func NewBackendStore

func NewBackendStore(
	ctx context.Context,
	apiKey, url, ownerName, repoName string,
	client *http.Client,
	updateInterval time.Duration,
	serverPort int32,
	sdkVersion string,
) (Store, error)

Constructs an in-memory store that fetches configs from lekko's backend.

func NewGitStore added in v0.2.1

func NewGitStore(
	ctx context.Context,
	apiKey, url, ownerName, repoName, path string,
	client *http.Client,
	port int32,
	sdkVersion string,
) (Store, error)

Constructs an in-memory store that fetches configs from a local git repo at the given path. If api key is empty, the store runs in local (offline) mode, and does not communicate with Lekko.

func NewStaticStore added in v0.4.0

func NewStaticStore(featureBytes map[string]map[string][]byte) (Store, error)

Jump to

Keyboard shortcuts

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