aclmanager

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 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 contains the struct for managing the state of ACLs

func New

func New(addr string, username string, password string, aclfile bool) *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) (int, error)

CurrentFunction checks if the current node is the Primary node

func (*AclManager) Loop

func (a *AclManager) Loop(ctx context.Context) 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) (*AclManager, error)

func (*AclManager) SyncAcls

func (a *AclManager) SyncAcls(ctx context.Context, primary *AclManager) ([]string, []string, 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