config

package
v0.0.0-...-4c137d3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: AGPL-3.0 Imports: 10 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 {
	Site     Site      `toml:"site"`
	Discord  Discord   `toml:"discord"`
	Database Database  `toml:"database"`
	Services []Service `toml:"services"`
}

Config is the application configuration.

func (*Config) FromFile

func (cfg *Config) FromFile(file string) error

FromFile parses the file and overrides the config.

type Database

type Database struct {
	Name    string `toml:"name"`
	Address string `toml:"address"`

	csufbot.Store `toml:"-"`
}

Database describes the configuration for the underlying database storage.

func (*Database) Open

func (dbcfg *Database) Open() (err error)

Open opens a new session storer from the given SessionConfig.

type Discord

type Discord struct {
	Token  string `toml:"token"`
	Secret string `toml:"secret"`
}

Discord describes the configuration for the Discord bot.

type Service

type Service struct {
	Name string `toml:"name"`
	Type string `toml:"type"`
	Icon string `toml:"icon"` // URL

	Host        lms.Host      `toml:"host"`
	Instruction template.HTML `toml:"instruction"` // HTML

	LMS lms.Service `toml:"-"`
}

Service describes a single hosted LMS service.

type Site

type Site struct {
	Address  string `toml:"address"`
	FrontURL string `toml:"fronturl"`

	SiteName   string `toml:"site_name"`
	Disclaimer string `toml:"disclaimer"`
}

Site describes the configuration for the HTTP server.

Jump to

Keyboard shortcuts

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