acl

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFeatureGreaterMax = errors.New("feature number is greater than the maximum")
	ErrUserNotFound      = errors.New("user not found")
)

Functions

This section is empty.

Types

type ACL

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

func (*ACL) AutoFlush

func (v *ACL) AutoFlush(ctx context.Context, interval time.Duration)

func (*ACL) Flush

func (v *ACL) Flush(email string)

func (*ACL) Get

func (v *ACL) Get(email string, feature uint16) (uint8, error)

func (*ACL) GetAll

func (v *ACL) GetAll(email string) ([]uint8, error)

func (*ACL) Set

func (v *ACL) Set(email string, feature uint16, level uint8) error

type IAcl

type IAcl 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.IStorage, size uint) IAcl

Jump to

Keyboard shortcuts

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