aclmanager

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Primary = iota
	Follower
)

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
}

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() (function int, err error)

CurrentFunction check if the current node is the Primary node

func (*AclManager) FindNodes

func (a *AclManager) FindNodes() (nodes []NodeInfo, err error)

FindNodes returns a list of nodes in the cluster based on the redis info replication command

func (*AclManager) Loop

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

Loop loops through the sync interval and syncs the acls

func (*AclManager) SyncAcls

func (a *AclManager) SyncAcls() (err error)

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

type NodeInfo

type NodeInfo struct {
	Address  string
	Function int
}

Jump to

Keyboard shortcuts

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