cfg

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RCONSettings       RCONSettings `yaml:"rcon_settings"`
	ArchiveTimeSeconds int32        `yaml:"archive_time_seconds"`
	Interval           string       `yaml:"interval"`
	Timeout            string       `yaml:"timeout"`
}

type ConfigManager

type ConfigManager interface {
	ReadConfig() Config
}

func NewConfigManager

func NewConfigManager() ConfigManager

NewConfigManager returns a ConfigManager interface

type RCONSettings

type RCONSettings struct {
	Endpoint string `yaml:"endpoint"`
	Password string `yaml:"password"`
}

type UserWhiteList

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

The UserWhiteList struct that implements the WhiteList interface

func NewUserWhiteList

func NewUserWhiteList() *UserWhiteList

func (*UserWhiteList) AddUser

func (u *UserWhiteList) AddUser(userID string) error

The AddUser method adds a user to the whitelist

func (*UserWhiteList) GetWhiteList

func (u *UserWhiteList) GetWhiteList() []string

The GetWhiteList method retrieves the whitelist

func (*UserWhiteList) Initialize

func (u *UserWhiteList) Initialize() error

The Initialize method initializes the whitelist

func (*UserWhiteList) IsInWhiteList

func (u *UserWhiteList) IsInWhiteList(userID string) bool

The IsInWhiteList method checks if a user is in the whitelist

func (*UserWhiteList) Reloaded

func (u *UserWhiteList) Reloaded() error

func (*UserWhiteList) RemoveUser

func (u *UserWhiteList) RemoveUser(userID string) error

The RemoveUser method deletes a user from the whitelist

func (*UserWhiteList) StartFileWatcher

func (u *UserWhiteList) StartFileWatcher() error

type WhiteList

type WhiteList interface {
	AddUser(userID string) error    // Adding user to the whitelist
	RemoveUser(userID string) error // Deleting user from the whitelist
	Reloaded() error
	Initialize() error                // Initializing whitelist
	GetWhiteList() []string           // retrieves the whitelist
	IsInWhiteList(userID string) bool // checks if a user is in the whitelist
	StartFileWatcher() error          // monitor
}

The WhiteList interface defines the methods for adding users, deleting users, and initializing the list

Jump to

Keyboard shortcuts

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