acl

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLevel = uint8(9)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL interface {
	GetAll(email string) ([]uint8, error)
	Get(email string, feature uint16) (uint8, error)
	Set(email string, feature uint16, level uint8) error
	Flush(email string)
	AutoFlush(ctx context.Context, interval time.Duration)
}

func New

func New(store Storage, size uint) ACL

type ConfigInConfigStorage

type ConfigInConfigStorage struct {
	ACL map[string]string `yaml:"acl_users"`
}

type OptionInMemoryStorage

type OptionInMemoryStorage func(v *storeInMemory)

func OptionInMemoryStorageSetupData

func OptionInMemoryStorageSetupData(data map[string]string) OptionInMemoryStorage

type Storage

type Storage interface {
	FindACL(email string) (string, error)
	ChangeACL(email, access string) error
}

func NewInConfigStorage

func NewInConfigStorage(c *ConfigInConfigStorage) Storage

func NewInMemoryStorage

func NewInMemoryStorage(opts ...OptionInMemoryStorage) Storage

Jump to

Keyboard shortcuts

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