config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseTypeBolt   = "bolt"
	DatabaseTypeMemory = "memory"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge added in v0.10.0

type Bridge struct {
	From          string         `json:"from" mapstructure:"from"`
	To            string         `json:"to" mapstructure:"to"`
	FromRegex     string         `json:"from_regex" mapstructure:"from_regex"`
	ToRegex       string         `json:"to_regex" mapstructure:"to_regex"`
	MatchTemplate string         `json:"match_template" mapstructure:"match_template"`
	Filters       []BridgeFilter `json:"filters" mapstructure:"filters"`
	Endpoints     []string       `json:"endpoints" mapstructure:"endpoints"`
}

type BridgeFilter added in v0.10.0

type BridgeFilter struct {
	From          string `json:"from" mapstructure:"from"`
	To            string `json:"to" mapstructure:"to"`
	FromRegex     string `json:"from_regex" mapstructure:"from_regex"`
	ToRegex       string `json:"to_regex" mapstructure:"to_regex"`
	MatchTemplate string `json:"match_template" mapstructure:"match_template"`
}

type Config

type Config struct {
	Memory    bool       `json:"memory" mapstructure:"memory"`
	Directory string     `json:"directory" mapstructure:"directory"`
	Database  Database   `json:"database" mapstructure:"database"`
	Storage   Storage    `json:"storage" mapstructure:"storage"`
	HTTP      HTTP       `json:"http" mapstructure:"http"`
	SMTP      SMTP       `json:"smtp" mapstructure:"smtp"`
	Endpoints []Endpoint `json:"endpoints" mapstructure:"endpoints"`
	Bridges   []Bridge   `json:"bridges" mapstructure:"bridges"`
}

func New

func New() *Config

func (*Config) Load

func (c *Config) Load()

type Database added in v0.10.0

type Database struct {
	Type   DatabaseType   `json:"type" mapstructure:"type"`
	Memory DatabaseMemory `json:"memory" mapstructure:"memory"`
	Bolt   DatabaseBolt   `json:"bolt" mapstructure:"bolt"`
}

func (Database) IsBolt added in v0.10.0

func (d Database) IsBolt() bool

func (Database) IsMemory added in v0.10.0

func (d Database) IsMemory() bool

type DatabaseBolt added in v0.10.0

type DatabaseBolt struct {
	File string `json:"-" mapstructure:"-"`
}

type DatabaseMemory added in v0.10.0

type DatabaseMemory struct {
	Limit int64 `json:"limit" mapstructure:"limit"`
}

type DatabaseType added in v0.10.0

type DatabaseType string

type Endpoint added in v0.10.0

type Endpoint struct {
	Name               string            `json:"name" mapstructure:"name"`
	TextDisable        bool              `json:"text_disable" mapstructure:"text_disable"`
	TextTemplate       string            `json:"text_template" mapstructure:"text_template"`
	AttachmentsDisable bool              `json:"attachments_disable" mapstructure:"attachments_disable"`
	Type               string            `json:"type" mapstructure:"type"`
	Config             map[string]string `json:"config" mapstructure:"config"`
}

type HTTP added in v0.10.0

type HTTP struct {
	Disable bool   `json:"disable" mapstructure:"disable"`
	Host    string `json:"host" mapstructure:"host"`
	Port    uint16 `json:"port" mapstructure:"port"`
}

func (HTTP) Addr added in v0.10.0

func (h HTTP) Addr() string

type SMTP added in v0.10.0

type SMTP struct {
	Disable  bool   `json:"disable" mapstructure:"disable"`
	Host     string `json:"host" mapstructure:"host"`
	Port     uint16 `json:"port" mapstructure:"port"`
	Size     int    `json:"size" mapstructure:"size"`
	Username string `json:"username" mapstructure:"username"`
	Password string `json:"password" mapstructure:"password"`
}

func (SMTP) Addr added in v0.10.0

func (s SMTP) Addr() string

func (SMTP) Auth added in v0.10.0

func (s SMTP) Auth() bool

type Storage added in v0.10.0

type Storage struct {
	Type   StorageType   `json:"type" mapstructure:"type"`
	Memory StorageMemory `json:"memory" mapstructure:"memory"`
	File   StorageFile   `json:"file" mapstructure:"file"`
}

func (Storage) IsFile added in v0.10.0

func (s Storage) IsFile() bool

func (Storage) IsMemory added in v0.10.0

func (s Storage) IsMemory() bool

type StorageFile added in v0.10.0

type StorageFile struct {
	Path string `json:"-" mapstructure:"-"`
}

type StorageMemory added in v0.10.0

type StorageMemory struct {
	Size int64 `json:"size" mapstructure:"size"`
}

type StorageType added in v0.10.0

type StorageType string
const (
	StorageTypeFile   StorageType = "file"
	StorageTypeMemory StorageType = "memory"
)

Jump to

Keyboard shortcuts

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