teg

package module
v0.0.0-...-44e5b1b Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 7 Imported by: 0

README

Teg

Teg is a library for manage feature toggles. It aims to allow to create and access to feature toggles in Golang easily and quickly!

Architecture

Teg reads feature toggles from lock-free in-memory storage and sync to in-memory storage from store.Reader.

Storage Backends

Teg comes with builtin storage backends. You can also use any storage backend with store.Reader interface.

type Reader interface {
    Get(name string) (*FeatureToggle, error)
    GetAll() (FeatureToggles, error)
}
Builtin Storage Backends
  • Environment Variable
  • Git Repository
  • InMemory

Update Triggers

Teg comes with builtin update triggers. You can also use any update triggers with TriggerFunc easily.

type TriggerFunc func(context.Context, chan<- struct{}) error
Builtin Update Triggers
  • Periodic Trigger
  • RabbitMQ

Example

If you want to use custom storage and custom update triggers checkout examples folder.

Status

Teg is usable but still under active development. We expect it to be production-ready in the near future.

Contributing

  • If you want to contribute to codes, create pull request
  • If you find any bugs or error, create an issue

License

This project is licensed under the MIT Lıcense

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithFilters

func WithFilters(val ...filter.Func) option

func WithStorage

func WithStorage(val storage.ReaderWriter) option

func WithSyncTrigger

func WithSyncTrigger(val sync.TriggerFunc) option

Types

type Teg

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

func New

func New(ctx context.Context, setters ...option) *Teg

func (*Teg) Get

func (t *Teg) Get(name string) bool

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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