flags

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

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