config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 5 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 {
	DB        ConfigDB         `json:"database" mapstructure:"database"`
	SMTP      ConfigSMTP       `json:"smtp" mapstructure:"smtp"`
	HTTP      ConfigHTTP       `json:"http" mapstructure:"http"`
	Bridges   []ConfigBridge   `json:"bridges" mapstructure:"bridges"`
	Endpoints []ConfigEndpoint `json:"endpoints" mapstructure:"endpoints"`
}

func New

func New() *Config

func (*Config) Load

func (c *Config) Load()

type ConfigBridge

type ConfigBridge struct {
	Name            string         `json:"name" mapstructure:"name"`
	Endpoints       []string       `json:"endpoints" mapstructure:"endpoints"`
	OnlyText        bool           `json:"only_text" mapstructure:"only_text"`
	OnlyAttachments bool           `json:"only_attachments" mapstructure:"only_attachments"`
	Filters         []ConfigFilter `json:"filters" mapstructure:"filters"`
}

type ConfigDB

type ConfigDB struct {
	Type        string `json:"type" mapstructure:"type"`
	DB          string `json:"db" mapstructure:"db"`
	Attachments string `json:"attachments" mapstructure:"attachments"`
}

func (*ConfigDB) IsBolt

func (db *ConfigDB) IsBolt() bool

type ConfigEndpoint

type ConfigEndpoint struct {
	Name   string            `json:"name" mapstructure:"name"`
	Type   string            `json:"type" mapstructure:"type"`
	Config map[string]string `json:"config" mapstructure:"config"`
}

type ConfigFilter

type ConfigFilter struct {
	To        string `json:"to,omitempty" mapstructure:"to,omitempty"`
	From      string `json:"from,omitempty" mapstructure:"from,omitempty"`
	ToRegex   string `json:"to_regex,omitempty" mapstructure:"to_regex,omitempty"`
	FromRegex string `json:"from_regex,omitempty" mapstructure:"from_regex,omitempty"`
}

type ConfigHTTP

type ConfigHTTP struct {
	Enable bool   `json:"enable" mapstructure:"enable"`
	Addr   string `json:"-" mapstructure:"-"`
	Host   string `json:"host" mapstructure:"host"`
	Port   uint16 `json:"port" mapstructure:"port"`
}

type ConfigSMTP

type ConfigSMTP struct {
	Addr     string `json:"-" mapstructure:"-"`
	Host     string `json:"host" mapstructure:"host"`
	Port     uint16 `json:"port" mapstructure:"port"`
	Size     int    `json:"size" mapstructure:"size"`
	Auth     bool   `json:"auth" mapstructure:"auth"`
	Username string `json:"username" mapstructure:"username"`
	Password string `json:"password" mapstructure:"password"`
}

Jump to

Keyboard shortcuts

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