config

package
v0.0.0-...-f961c5b Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 4 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 {
	Database ConfigDatabase      `json:"database"`
	Discord  ConfigDiscord       `json:"discord"`
	Email    ConfigEmail         `json:"email"`
	Facility ConfigFacility      `json:"facility"`
	Features ConfigFeatures      `json:"features"`
	Groups   map[string][]string `json:"groups"`
	Metrics  ConfigMetrics       `json:"metrics"`
	OAuth    ConfigOAuth         `json:"oauth"`
	Server   ConfigServer        `json:"server"`
	Session  ConfigSession       `json:"session"`
	Storage  ConfigStorage       `json:"storage"`
	VATUSA   ConfigVATUSA        `json:"vatusa"`
}
var Cfg *Config

func ParseConfig

func ParseConfig(file string) (*Config, error)

type ConfigDatabase

type ConfigDatabase struct {
	Host        string `json:"host"`
	Port        string `json:"port"`
	User        string `json:"user"`
	Password    string `json:"password"`
	Database    string `json:"database"`
	Automigrate bool   `json:"automigrate"`
	CACert      string `json:"ca_cert"`
}

type ConfigDiscord

type ConfigDiscord struct {
	Webhooks     map[string]string `json:"webhooks"`
	ClientID     string            `json:"client_id"`
	ClientSecret string            `json:"client_secret"`
}

type ConfigEmail

type ConfigEmail struct {
	Host        string `json:"host"`
	Port        string `json:"port"`
	User        string `json:"user"`
	Password    string `json:"password"`
	From        string `json:"from"`
	TemplateDir string `json:"template_dir"`
}

type ConfigFacility

type ConfigFacility struct {
	Activity         ConfigFacilityActivity `json:"activity"`
	Stats            ConfigFacilityStats    `json:"stats"`
	Visiting         ConfigFacilityVisiting `json:"visiting"`
	TrainingRequests ConfigFacilityTraining `json:"training_requests"`
	FrontendURL      string                 `json:"frontend_url"`
}

type ConfigFacilityActivity

type ConfigFacilityActivity struct {
	Inactive ConfigFacilityActivityInactive `json:"inactive"`
	Warning  ConfigFacilityActivityWarning  `json:"warning"`
}

type ConfigFacilityActivityInactive

type ConfigFacilityActivityInactive struct {
	Enabled  bool  `json:"enabled"`
	Period   int   `json:"period"`
	MinHours int   `json:"min_hours"`
	Months   []int `json:"months"`
}

type ConfigFacilityActivityWarning

type ConfigFacilityActivityWarning struct {
	Enabled    bool  `json:"enabled"`
	DaysBefore int   `json:"days_before"`
	Months     []int `json:"months"`
}

type ConfigFacilityStats

type ConfigFacilityStats struct {
	Enabled  bool     `json:"enabled"`
	Prefixes []string `json:"prefixes"`
}

type ConfigFacilityTraining

type ConfigFacilityTraining struct {
	Enabled            bool                          `json:"enabled"`
	Discord            ConfigFacilityTrainingDiscord `json:"discord"`
	Positions          []string                      `json:"positions"`
	MaxRequestsPerUser int                           `json:"max_requests_per_user"`
	SendToDiscord      bool                          `json:"send_to_discord"`
}

type ConfigFacilityTrainingDiscord

type ConfigFacilityTrainingDiscord struct {
	TrainingStaff    string `json:"training_staff"`
	Scheduled        string `json:"scheduled"`
	ShowAllScheduled bool   `json:"show_all_scheduled"`
}

type ConfigFacilityVisiting

type ConfigFacilityVisiting struct {
	SendWelcome  bool `json:"send_welcome"`
	SendRemoval  bool `json:"send_removal"`
	SendRejected bool `json:"send_rejected"`
}

type ConfigFeatures

type ConfigFeatures struct {
	StaffingRequest         bool `json:"staffing_request"`
	ControllerOnline        bool `json:"controller_online"`
	IgnoreUnknownController bool `json:"ignore_unknown_controller"`
}

type ConfigMetrics

type ConfigMetrics struct {
	Enabled bool   `json:"enabled"`
	Port    int    `json:"port"`
	Path    string `json:"path"`
}

type ConfigOAuth

type ConfigOAuth struct {
	BaseURL      string `json:"base_URL"`
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	MyBaseURL    string `json:"my_base_URL"`

	Endpoints ConfigOAuthEndpoints `json:"endpoints"`
}

type ConfigOAuthEndpoints

type ConfigOAuthEndpoints struct {
	Authorize string `json:"authorize"`
	Token     string `json:"token"`
	UserInfo  string `json:"user"`
}

type ConfigServer

type ConfigServer struct {
	Host string `json:"host"`
	Port string `json:"port"`
}

type ConfigSession

type ConfigSession struct {
	Cookie ConfigSessionCookie `json:"cookie"`
}

type ConfigSessionCookie

type ConfigSessionCookie struct {
	Name     string `json:"name"`
	Secret   string `json:"secret"`
	Domain   string `json:"domain"`
	Path     string `json:"path"`
	MaxAge   int    `json:"max_age"`
	Secure   bool   `json:"secure"`
	SameSite string `json:"same_site"`
}

type ConfigStorage

type ConfigStorage struct {
	BaseURL   string `json:"base_URL"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	Bucket    string `json:"bucket"`
	Region    string `json:"region"`
	Endpoint  string `json:"endpoint"`
}

type ConfigVATUSA

type ConfigVATUSA struct {
	Facility string `json:"facility"`
	APIKey   string `json:"api_key"`
	TestMode bool   `json:"test_mode"`
}

Jump to

Keyboard shortcuts

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