storage

package
v0.0.0-...-e7bb422 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugin = plugins.Plugin{
	Inject: NewStorages,
}

Functions

func Validate

func Validate(name string) bool

Types

type Cache

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

func NewCache

func NewCache(count int) *Cache

func (*Cache) Delete

func (v *Cache) Delete(name string)

func (*Cache) FlushAll

func (v *Cache) FlushAll()

func (*Cache) Get

func (v *Cache) Get(name string) (Store, bool)

func (*Cache) Set

func (v *Cache) Set(s Store)

type Storages

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

func NewStorages

func NewStorages(db db.DB) *Storages

func (*Storages) AppendStorageToGroups

func (v *Storages) AppendStorageToGroups(ctx context.Context, name string, groups ...int64) error

func (*Storages) CreateStore

func (v *Storages) CreateStore(ctx context.Context, name, code string, lifetime int64) error

func (*Storages) DeleteStoreFromGroup

func (v *Storages) DeleteStoreFromGroup(ctx context.Context, name string, groups ...int64) error

func (*Storages) Down

func (v *Storages) Down() error

func (*Storages) Get

func (v *Storages) Get(ctx context.Context, name string) (*Store, error)

func (*Storages) Up

func (v *Storages) Up(ctx app.Context) error

type Store

type Store struct {
	ID       int64
	Lifetime int64
	Name     string
	Code     string
	Groups   map[int64]struct{}
}

func (Store) GetGroups

func (v Store) GetGroups() []int64

Jump to

Keyboard shortcuts

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