common

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Info added in v0.0.2

func Info(v ...any)

func SilentError

func SilentError(v ...any)

func StrIsInSlice

func StrIsInSlice(element string, slice []string) bool

func StrRemoveProtocol

func StrRemoveProtocol(url string) (string, error)

func StrRemoveSpaces

func StrRemoveSpaces(input string) string

Types

type AdminConfig added in v0.0.2

type AdminConfig struct {
	Enabled    bool   `yaml:"enable"`
	Path       string `yaml:"path"`
	Passphrase string `yaml:"passphrase"`
	GuestLogin string `yaml:"guest_login_password"`
}

type Config

type Config struct {
	Host      string      `yaml:"host"`
	Port      int         `yaml:"listen"`
	ImgTheme  string      `yaml:"img_theme"`
	Cors      bool        `yaml:"cors"`
	Hostnames []string    `yaml:"hostnames"`
	ErrorLog  string      `yaml:"error_log"`
	DBCfg     DBConfig    `yaml:"db"`
	AdminCfg  AdminConfig `yaml:"admin"`
}

type Counter added in v0.0.2

type Counter struct {
	Id          int       `db:"id"`
	Identifier  string    `db:"identifier"`
	Count       int       `db:"count"`
	CreatedTime time.Time `db:"created_id"`
}

type DBConfig

type DBConfig struct {
	Type     string `yaml:"type"`
	Dbname   string `yaml:"dbname"`
	Host     string `yaml:"host"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Logger

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

func (Logger) InitLogger

func (l Logger) InitLogger(path string)

Jump to

Keyboard shortcuts

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