fflag

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDatabaseRead added in v0.3.3

func WithDatabaseRead(db db.Manager) common.Option[manager]

func WithExecuteMigration added in v0.3.4

func WithExecuteMigration(enabled bool, dir ...string) common.Option[manager]

func WithLazyLoadData added in v0.3.4

func WithLazyLoadData(v bool) common.Option[manager]

func WithLogger added in v0.3.4

func WithLogger(log logger.Manager) common.Option[manager]

Types

type Manager

type Manager interface {
	Add(ctx context.Context, records ...Record) error
	ExecWhenEnabled(ctx context.Context, feature string, f func())
	IsEnabled(ctx context.Context, feature string) bool

	Init() error
	MustInit() Manager
	AddOptions(opts ...common.Option[manager]) Manager
	// contains filtered or unexported methods
}

func New

func New(db db.Manager, opts ...common.Option[manager]) Manager

type Record

type Record struct {
	Id            int64      `db:"id"`
	Feature       string     `db:"feature"`
	Enabled       bool       `db:"enabled"`
	LastChangedBy string     `db:"last_changed_by"`
	CreatedAt     time.Time  `db:"created_at"`
	UpdatedAt     *time.Time `db:"updated_at"`
}

type Records added in v0.3.4

type Records []*Record

Jump to

Keyboard shortcuts

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