fflags

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	METADATA_KIND         = "kind"
	SERVING_METADATA_KIND = "operational-serving"
	SERVING_FLAG_SUFFIX   = "serving"

	SERVING_STATUS_SERVING     ServingStatus = "serving"
	SERVING_STATUS_NOT_SERVING ServingStatus = "not-serving"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStore

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

BlobStore holds the components of a feature flag storage location.

func NewBlobStore

func NewBlobStore(in string) (*BlobStore, error)

NewBlobStore parses the input URI and returns a new BlobStore instance.

func (*BlobStore) Bucket

func (b *BlobStore) Bucket() string

Bucket returns the scheme and bucket or file path.

func (*BlobStore) Object

func (b *BlobStore) Object() string

Object returns the filename or object key of the blob.

func (*BlobStore) Retriever

func (b *BlobStore) Retriever() retriever.Retriever

Retriever creates a go-feature-flag Retriever based on the blob store kind.

type Manager

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

Manager provides methods to manage and evaluate feature flags.

func NewManager

func NewManager(blobstore string, opts ...Option) (*Manager, error)

NewManager initializes a new Manager with the provided storage URI and options.

func (*Manager) Client

func (m *Manager) Client() *ffclient.GoFeatureFlag

Client provides access to the initialized go-feature-flag evaluation client.

func (*Manager) Close

func (m *Manager) Close()

Close gracefully shuts down the underlying feature flag client.

func (*Manager) CreateServing

func (m *Manager) CreateServing(ctx context.Context, service string, status ServingStatus) error

CreateServing initializes a new serving flag for the specified service with the given status.

func (*Manager) DeleteServing

func (m *Manager) DeleteServing(ctx context.Context, service string) error

DeleteServing permanently removes the serving flag for the specified service.

func (*Manager) Dump

func (m *Manager) Dump(ctx context.Context) (map[string]dto.DTO, error)

Dump loads and returns all current feature flags from the underlying storage.

func (*Manager) GetServing

func (m *Manager) GetServing(ctx context.Context, service string) (ServingStatus, error)

GetServing retrieves the ServingStatus for the specified service.

func (*Manager) IsServing

func (m *Manager) IsServing(ctx context.Context, service string) (bool, error)

IsServing returns true if the specified service is currently serving traffic.

func (*Manager) SetServing

func (m *Manager) SetServing(ctx context.Context, service string, status ServingStatus) error

SetServing updates the ServingStatus for an existing service, altering its serving state.

type Option

type Option func(*Manager)

Option is a functional option pattern for configuring a Manager.

func WithRefresh

func WithRefresh(refresh time.Duration) Option

WithRefresh configures the cache polling interval for the Manager.

type ServingStatus

type ServingStatus string

ServingStatus represents the current serving state of a service.

func (ServingStatus) String

func (s ServingStatus) String() string

String returns the string representation of the ServingStatus.

func (ServingStatus) StringP

func (s ServingStatus) StringP() *string

StringP returns a pointer to the string representation of the ServingStatus.

Jump to

Keyboard shortcuts

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