config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Global = Config{}

Global is meant to ease access to global configuration, instead of passing it around.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version     bool      `desc:"display current version"`
	ConfPath    string    `id:"confpath" desc:"path to config file"`
	LogLevel    string    `default:"warn" short:"l" desc:"log level (debug/info/warn/error)"`
	GracePeriod *Duration `desc:"time to wait for ongoing calls during shutdown" default:"60s"`
	PBX         PBX
	Zammad      Zammad
}

Config holds the configurable options with their respective defaults.

func (*Config) String

func (c *Config) String() string

Used by expvar

type Duration

type Duration time.Duration

Duration wraps time.Duration, adding UnmarshalText for config-parsing

func (*Duration) MarshalJSON added in v0.1.3

func (d *Duration) MarshalJSON() ([]byte, error)

MarshalJSON returns a json-string representation of the duration

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(data []byte) error

UnmarshalText parses the provided byte array into the duration receiver as text

type PBX added in v0.2.0

type PBX struct {
	URL            string    `desc:"URL to innovaphone PBX"`
	EndpointPath   string    `default:"/PBX0/user.soap" desc:"path on innovaphone PBX under which the API is accessible"`
	User           string    `desc:"user for authentication with the PBX"`
	Pass           string    `desc:"password for authentication with the PBX"`
	AppName        string    `default:"innovazammad" desc:"application name used when accessing PBX"`
	MonitorUser    string    `desc:"PBX user used for monitoring calls; usually a 'trunk line'"`
	FilterOnGroup  string    `desc:"only process calls for users in this group (if not provided, will submit all calls to Zammad)"`
	GroupCacheTime *Duration `` /* 163-byte string literal not displayed */
}

PBX holds PBX-specific configuration

type Zammad added in v0.2.0

type Zammad struct {
	EndpointURL  string `desc:"URL to Zammad's 'CTI (generic)' endpoint"`
	TrunkPrefix  string `` /* 143-byte string literal not displayed */
	CountryCode  int    `default:"49" desc:"Country code to prepend to area-local phone numbers received from the PBX"`
	NumberPrefix string `` /* 161-byte string literal not displayed */
}

Zammad holds Zammad-specific configuration

Jump to

Keyboard shortcuts

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