config

package
v0.0.0-...-2935971 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyConf

func AnyConf(loc, filename string, cfg interface{}) error

AnyConf is like AConf but it accepts any struct and will attempt to unmarshal the config file in the location defined by prefix into it

func CheckDirExist

func CheckDirExist(loc string) bool

CheckDirExist is a lazy function to determine if a directory exists or not

func CheckExist

func CheckExist(loc string) bool

CheckExist is a lazy function to determine if a file exists or not

Types

type Auth

type Auth struct {
	Token string
}

Auth contains authentication configuration

type Bot

type Bot struct {
	Debugm bool
	Prefix []string
	Admins []string

	DebugCommands bool `toml:"EnableDebugCommands"`
}

Bot contains some general purpose configuration

type Config

type Config struct {
	Auth    Auth
	Bot     Bot
	Logging Logging
}

Config contains the core configuration for the bot, i mean what else would it contain

func AConf

func AConf(loc string) (Config, error)

AConf is a function dedicated to checking various locations for a config, and loading that config

func Load

func Load(loc string) (cfg Config, err error)

Load loads a toml based config file

type Logging

type Logging struct {
	Webhooks struct {
		Info string
		Errs string
		Spam string
	}
	InfoPfp    string
	ErrsPfp    string
	SpamPfp    string
	NamePrefix string
}

Logging contains some logging configs

Jump to

Keyboard shortcuts

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