flags

package
v1.16.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxNameLength = 50

Variables

This section is empty.

Functions

func NewKeyFromName

func NewKeyFromName(name string) (string, error)

NewKeyFromName creates a valid key from the name.

Types

type Client

type Client interface {
	Create(ctx context.Context, accessToken, baseURI, name, key, projKey string) ([]byte, error)
	Get(ctx context.Context, accessToken, baseURI, key, projKey, envKey string) ([]byte, error)
	Update(
		ctx context.Context,
		accessToken,
		baseURI,
		key,
		projKey string,
		patch []UpdateInput,
	) ([]byte, error)
}

type FlagsClient

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

func NewClient

func NewClient(cliVersion string) FlagsClient

func (FlagsClient) Create

func (c FlagsClient) Create(
	ctx context.Context,
	accessToken,
	baseURI,
	name,
	key,
	projectKey string,
) ([]byte, error)

func (FlagsClient) Get

func (c FlagsClient) Get(
	ctx context.Context,
	accessToken,
	baseURI,
	key,
	projectKey,
	environmentKey string,
) ([]byte, error)

func (FlagsClient) Update

func (c FlagsClient) Update(
	ctx context.Context,
	accessToken,
	baseURI,
	key,
	projKey string,
	input []UpdateInput,
) ([]byte, error)

type MockClient

type MockClient struct {
	mock.Mock
}

func (*MockClient) Create

func (c *MockClient) Create(
	ctx context.Context,
	accessToken,
	baseURI,
	name,
	key,
	projKey string,
) ([]byte, error)

func (*MockClient) Get

func (c *MockClient) Get(
	ctx context.Context,
	accessToken,
	baseURI,
	key,
	projKey,
	envKey string,
) ([]byte, error)

func (*MockClient) Update

func (c *MockClient) Update(
	ctx context.Context,
	accessToken,
	baseURI,
	key,
	projKey string,
	patch []UpdateInput,
) ([]byte, error)

type UpdateInput

type UpdateInput struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

func BuildToggleFlagPatch

func BuildToggleFlagPatch(envKey string, enabled bool) []UpdateInput

Jump to

Keyboard shortcuts

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