memory

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigNotFound error = fmt.Errorf("config not found")
)

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.

Jump to

Keyboard shortcuts

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