config

package
v0.0.0-...-b84af7b Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap()

func MergeUpdate

func MergeUpdate(config map[string]interface{}) error

Types

type Anzu

type Anzu struct {
	Site     anzuSite
	Homedir  string
	Security anzuSecurity
	Mail     anzuMail
	Oauth    OauthConfig
	Runtime  anzuRuntime
}

Anzu config params struct.

type BanEffects

type BanEffects struct {
	Duration  int64
	IPAddress bool
}

BanEffects def.

type BanReason

type BanReason struct {
	Code string `hcl:"effects"`
}

BanReason config def.

func (BanReason) Effects

func (re BanReason) Effects(related string, times int) (BanEffects, error)

Effects from config (duration, ipaddress).

type Config

type Config struct {
	Reload chan struct{}
	// contains filtered or unexported fields
}
var (
	// C stands for config
	C *Config

	// LoggingBackend packages should use.
	LoggingBackend logging.LeveledBackend
)

func (*Config) Boot

func (c *Config) Boot()

func (*Config) Copy

func (c *Config) Copy() Anzu

func (*Config) Hermes

func (c *Config) Hermes() hermes.Hermes

func (*Config) Merge

func (c *Config) Merge(file string, reload bool)

func (*Config) Rules

func (c *Config) Rules() Rules

func (*Config) UserCopy

func (c *Config) UserCopy() (conf map[string]interface{})

func (*Config) WatchFile

func (c *Config) WatchFile(file string)

type Flag

type Flag struct {
	ShouldRemove string `hcl:"shouldRemove"`
	ShouldBan    string `hcl:"shouldBan"`
}

type OauthConfig

type OauthConfig struct {
	Facebook OauthKeys
	Google   OauthKeys
}

type OauthKeys

type OauthKeys struct {
	Key      string
	Secret   string
	Callback string
}

type ReactionEffect

type ReactionEffect struct {
	Code string `hcl:"exec"`
}

func (ReactionEffect) Rewards

func (re ReactionEffect) Rewards() (Rewards, error)

Rewards is a way to transform the reaction code from system config (javascript definition) into a reward struct.

type Rewards

type Rewards struct {
	Provider int64
	Receiver int64
}

type Rules

type Rules struct {
	Reactions  map[string]*ReactionEffect `hcl:"reaction"`
	BanReasons map[string]*BanReason      `hcl:"banReason"`
	Flags      map[string]*Flag           `hcl:"flag"`
}

Jump to

Keyboard shortcuts

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