aclmanager

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Primary = iota
	Follower
	Unknown
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AclManager

type AclManager struct {
	Addr        string
	Username    string
	Password    string
	RedisClient *redis.Client
	// contains filtered or unexported fields
}

AclManager containers the struct for bedel to manager the state of aclmanager acls

func New

func New(addr string, username string, password string) *AclManager

New creates a new AclManager

func (*AclManager) Close

func (a *AclManager) Close() error

Close closes the redis client

func (*AclManager) CurrentFunction

func (a *AclManager) CurrentFunction(ctx context.Context) (function int, err error)

CurrentFunction check if the current node is the Primary node

func (*AclManager) Loop

func (a *AclManager) Loop(ctx context.Context) (err error)

Loop loops through the sync interval and syncs the acls

func (*AclManager) Primary added in v0.0.2

func (a *AclManager) Primary(ctx context.Context) (primary *AclManager, err error)

func (*AclManager) SyncAcls

func (a *AclManager) SyncAcls(ctx context.Context, primary *AclManager) (updated []string, deleted []string, err error)

SyncAcls connects to master node and syncs the acls to the current node

Jump to

Keyboard shortcuts

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