config

package
v0.0.0-...-05965fc Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var Default = Config{}

DefaultConfig defines the default Config to be used to set default values.

Functions

func MakeDuration

func MakeDuration(target string, def uint64) time.Duration

MakeDuration should become internal functions, config should return time.Duration

Types

type Config

type Config struct {
	toml.MetaData

	Listener toml.Primitive `toml:"listener"`

	Web toml.Primitive `toml:"web"`

	Services  map[string]toml.Primitive `toml:"service"`
	Ports     []toml.Primitive          `toml:"port"`
	Directors map[string]toml.Primitive `toml:"director"`
	Channels  map[string]toml.Primitive `toml:"channel"`

	Filters []toml.Primitive `toml:"filter"`

	Logging []struct {
		Output string `toml:"output"`
		Level  string `toml:"level"`
	} `toml:"logging"`
}

Config defines the central type where all configuration is umarhsalled to.

func (*Config) Load

func (c *Config) Load(r io.Reader) error

Load attempts to load the giving toml configuration file.

type Delay

type Delay time.Duration

Delay defines a duration type.

func (*Delay) Duration

func (t *Delay) Duration() time.Duration

Duration returns the type of the giving duration from the provided pointer.

func (*Delay) UnmarshalText

func (t *Delay) UnmarshalText(text []byte) error

UnmarshalText handles unmarshalling duration values from the provided slice.

Jump to

Keyboard shortcuts

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