cmd

package
v0.0.0-...-b4c3900 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG loggingLevel = iota
	INFO
	WARNING
	ERROR
)

Variables

View Source
var StatsInstance = &Stats{}

Functions

func BootServer

func BootServer(version string, readyChannel chan *BucketsDb)

func CheckPortAvail

func CheckPortAvail(port string) bool

CheckPortAvail if a port is available

func EnvInit

func EnvInit()

EnvInit - Called at startup.

func ProcessUnixCommands

func ProcessUnixCommands()

func SendError

func SendError(writer http.ResponseWriter, message string, status int)

Types

type AuthSecret

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

func NewAuthSecret

func NewAuthSecret(secret string) *AuthSecret

func (*AuthSecret) Middleware

func (mw *AuthSecret) Middleware(next http.Handler) http.Handler

type BackupData

type BackupData struct {
	Status      string
	LastStart   time.Time
	LastEnd     time.Time
	LastMessage string
}

type BadgerLogger

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

func DefaultLogger

func DefaultLogger(level loggingLevel) *BadgerLogger

func (*BadgerLogger) Debugf

func (l *BadgerLogger) Debugf(f string, v ...interface{})

func (*BadgerLogger) Errorf

func (l *BadgerLogger) Errorf(f string, v ...interface{})

func (*BadgerLogger) Infof

func (l *BadgerLogger) Infof(f string, v ...interface{})

func (*BadgerLogger) Warningf

func (l *BadgerLogger) Warningf(f string, v ...interface{})

type BucketStats

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

type BucketsDb

type BucketsDb struct {
	DbBucket map[common.BucketName]*badger.DB

	ServerState ServerState

	Jobs []*common.ScpJob
	// contains filtered or unexported fields
}
var BucketsInstance *BucketsDb

func (*BucketsDb) Close

func (b *BucketsDb) Close()

func (*BucketsDb) Init

func (b *BucketsDb) Init()

func (*BucketsDb) Open

func (b *BucketsDb) Open(name common.BucketName) error

func (*BucketsDb) WaitTillStarted

func (b *BucketsDb) WaitTillStarted()

func (*BucketsDb) WaitTillStopped

func (b *BucketsDb) WaitTillStopped()

type Environment

type Environment struct {
	// contains filtered or unexported fields
}
var EnvironmentInstance Environment = Environment{
	// contains filtered or unexported fields
}

func (*Environment) GetBackupGoRoutineNumber

func (e *Environment) GetBackupGoRoutineNumber() int

func (*Environment) GetBackupGraceHours

func (e *Environment) GetBackupGraceHours() int

func (*Environment) GetBloomFalsePercentage

func (e *Environment) GetBloomFalsePercentage() float64

func (*Environment) GetBoolEnv

func (e *Environment) GetBoolEnv(key string) bool

GetBoolEnv - reads an Environment variable and converts to a boolean.

	true values are:   "1", "t", "T", "true", "TRUE", "True"
	false values are:  "0", "f", "F", "false", "FALSE", "False"
 any other value will panic with an appropriate message

func (*Environment) GetBucketArray

func (e *Environment) GetBucketArray(key string) []BucketName

func (*Environment) GetEnv

func (e *Environment) GetEnv(key string, fallback string) string

GetEnv -- Gets the value of the Environment. If not specified and no default in the .env file it will return fallback

func (*Environment) GetFloat

func (e *Environment) GetFloat(key string, dflt float64) float64

func (*Environment) GetInt

func (e *Environment) GetInt(key string, dflt int) int

func (*Environment) GetIntArray

func (e *Environment) GetIntArray(key string) []int

func (*Environment) LookupEnv

func (e *Environment) LookupEnv(key string) (string, bool)

type ServerState

type ServerState int
const Running ServerState = 1
const Starting ServerState = 0
const Stopped ServerState = 2

type Stats

type Stats struct {
	Backups map[common.BucketName]*BackupData

	LastBKRunLoop time.Time
	LastBKStart   time.Time
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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