config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAddress  = ":8032"
	DefaultHostName = "texit-discord-bot"
	DefaultTsState  = "/var/lib/texit-discord/tsstate"
)

Variables

View Source
var (
	ErrMissingApplicationId = errors.New("missing applicationId")
	ErrMissingPublicKey     = errors.New("missing publicKey")
	ErrMissingToken         = errors.New("missing token")
)
View Source
var (
	ErrMissingTailnetAuthKey = errors.New("missing tailnet preauth key")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Api     config.ApiConfig `yaml:"api"`
	Server  ServerConfig     `yaml:"server"`
	Discord DiscordBotConfig `yaml:"discord"`
}

func (Config) Validate

func (c Config) Validate() error

type DiscordBotConfig

type DiscordBotConfig struct {
	ApplicationId string   `yaml:"applicationId"`
	PublicKey     string   `yaml:"publicKey"`
	GuildIds      []string `yaml:"guildIds"`
	Token         string   `yaml:"token"`
	Authorized    []string `yaml:"authorized"`
}

func (*DiscordBotConfig) AuthorizedAsSnowflakes added in v0.0.6

func (c *DiscordBotConfig) AuthorizedAsSnowflakes() ([]tempest.Snowflake, error)

func (*DiscordBotConfig) AuthorizedGuildsAsSnowflakes added in v0.0.6

func (c *DiscordBotConfig) AuthorizedGuildsAsSnowflakes() ([]tempest.Snowflake, error)

func (*DiscordBotConfig) Validate

func (c *DiscordBotConfig) Validate() error

type ServerConfig

type ServerConfig struct {
	Address string      `yaml:"address"`
	Tailnet *tsn.Config `yaml:"tailnet"`
}

func (*ServerConfig) Validate

func (c *ServerConfig) Validate() error

Jump to

Keyboard shortcuts

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