server

package
v1.0.0-SNAPSHOT...-0150756 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * 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

View Source
const DefaultAddress = "0.0.0.0"

defines the default address to listen on when none is given

View Source
const DefaultPort = 36623

defines the default port to listen on when none is given

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PluginDir        *string        `hcl:"plugin-dir"`
	BindAddress      *string        `hcl:"bind-address,attr"`
	UiEnabled        *bool          `hcl:"ui,attr"`
	LegacyApiEnabled *bool          `hcl:"legacy-api,attr"`
	Storage          *StorageConfig `hcl:"storage,block"`
	Ttl              *TtlConfig     `hcl:"ttl,block"`
}

Represents a server configuration (typically parsed from one or more HCL files)

func DefaultConfig

func DefaultConfig() *Config

func DevelopmentConfig

func DevelopmentConfig() *Config

func EmptyConfig

func EmptyConfig() *Config

Creates an empty configuration

func LoadConfig

func LoadConfig(path string) (*Config, error)

Loads a file or directory

func LoadConfigDirectory

func LoadConfigDirectory(path string) (*Config, error)

Loads an entire directory of configuration files

func LoadConfigFile

func LoadConfigFile(path string) (*Config, error)

Loads a single configuration file

func (*Config) Merge

func (c *Config) Merge(other *Config) *Config

Merges two configuration instances into one

func (*Config) Parse

func (c *Config) Parse() error

type StorageConfig

type StorageConfig struct {
	Type       string   `hcl:"type,label"`
	Parameters hcl.Body `hcl:",remain"`
}

Represents a storage backend configuration The "type" parameter will simply equal the executable name within the plugin directory while all parameters are passed on upon startup

func (*StorageConfig) Merge

func (c *StorageConfig) Merge(other *StorageConfig) *StorageConfig

type TtlConfig

type TtlConfig struct {
	Name           time.Duration
	RawName        string `hcl:"name,attr"`
	NameHistory    time.Duration
	RawNameHistory string `hcl:"name-history,attr"`
	Profile        time.Duration
	RawProfile     string `hcl:"profile,attr"`
	Blacklist      time.Duration
	RawBlacklist   string `hcl:"blacklist,attr"`
}

Represents the TTL (Time To Live) configuration (e.g. caching durations for various value types)

func (*TtlConfig) Merge

func (c *TtlConfig) Merge(other *TtlConfig) *TtlConfig

func (*TtlConfig) Parse

func (c *TtlConfig) Parse() error

Directories

Path Synopsis
* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log.
* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log.
* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log.
* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log.
* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log.
* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log.

Jump to

Keyboard shortcuts

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