badger

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCacheSize = 100 << 20 // 100 MB
View Source
var ErrFuncExit = errors.New("function exit")

Functions

func CheckAccess

func CheckAccess(perm *data.Permission, pathRequest, method string) bool

Types

type Badger

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

func New

func New(path string) (*Badger, error)

func (*Badger) Backup added in v0.7.4

func (b *Badger) Backup(w io.Writer, since uint64) error

func (*Badger) Check

func (b *Badger) Check(req data.CheckRequest) (*data.CheckResponse, error)

func (*Badger) Close

func (b *Badger) Close() error

func (*Badger) CreateLMap

func (b *Badger) CreateLMap(lmap data.LMap) error

func (*Badger) CreatePermission

func (b *Badger) CreatePermission(permission data.Permission) (string, error)

func (*Badger) CreateRole

func (b *Badger) CreateRole(role data.Role) (string, error)

func (*Badger) CreateUser

func (b *Badger) CreateUser(user data.User) (string, error)

func (*Badger) DeleteLMap

func (b *Badger) DeleteLMap(name string) error

func (*Badger) DeletePermission

func (b *Badger) DeletePermission(id string) error

func (*Badger) DeleteRole

func (b *Badger) DeleteRole(id string) error

func (*Badger) DeleteUser

func (b *Badger) DeleteUser(id string) error

func (*Badger) GetLMap

func (b *Badger) GetLMap(name string) (*data.LMap, error)

func (*Badger) GetLMaps

func (b *Badger) GetLMaps(req data.GetLMapRequest) (*data.Response[[]data.LMap], error)

func (*Badger) GetPermission

func (b *Badger) GetPermission(name string) (*data.Permission, error)

func (*Badger) GetPermissions

func (b *Badger) GetPermissions(req data.GetPermissionRequest) (*data.Response[[]data.Permission], error)

func (*Badger) GetRole

func (b *Badger) GetRole(id string) (*data.Role, error)

func (*Badger) GetRoles

func (b *Badger) GetRoles(req data.GetRoleRequest) (*data.Response[[]data.Role], error)

func (*Badger) GetUser

func (b *Badger) GetUser(req data.GetUserRequest) (*data.UserExtended, error)

func (*Badger) GetUsers

func (b *Badger) GetUsers(req data.GetUserRequest) (*data.Response[[]data.UserExtended], error)

func (*Badger) LMapRoleIDs added in v0.7.3

func (b *Badger) LMapRoleIDs() data.LMapRoleIDs

func (*Badger) PatchPermission added in v0.7.3

func (b *Badger) PatchPermission(patch data.Permission) error

func (*Badger) PatchRole added in v0.7.3

func (b *Badger) PatchRole(role data.Role) error

func (*Badger) PatchUser

func (b *Badger) PatchUser(user data.User) error

func (*Badger) PutLMap

func (b *Badger) PutLMap(lmap data.LMap) error

func (*Badger) PutPermission

func (b *Badger) PutPermission(permission data.Permission) error

func (*Badger) PutRole

func (b *Badger) PutRole(role data.Role) error

func (*Badger) PutUser

func (b *Badger) PutUser(user data.User) error

func (*Badger) Restore added in v0.7.4

func (b *Badger) Restore(r io.Reader) error

type LMapCacheRoleIDs added in v0.7.3

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

func NewLMapCacheRoleIDs added in v0.7.3

func NewLMapCacheRoleIDs(b *Badger) *LMapCacheRoleIDs

func (*LMapCacheRoleIDs) Get added in v0.7.3

func (l *LMapCacheRoleIDs) Get(names []string) ([]string, error)

type Logger added in v0.7.4

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

func NewLogger added in v0.7.4

func NewLogger() *Logger

func (*Logger) Debugf added in v0.7.4

func (l *Logger) Debugf(format string, v ...interface{})

func (*Logger) Errorf added in v0.7.4

func (l *Logger) Errorf(format string, v ...interface{})

func (*Logger) Infof added in v0.7.4

func (l *Logger) Infof(format string, v ...interface{})

func (*Logger) Warningf added in v0.7.4

func (l *Logger) Warningf(format string, v ...interface{})

Jump to

Keyboard shortcuts

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