config

package
v0.0.0-...-581b1ea Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config contains the configuration file format for stenographer's main configuration file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StenotypePath string
	Threads       []ThreadConfig
	Interface     string
	Flags         []string
	Port          int
	Host          string // Location to listen.
	MaxOpenFiles  int    // Max number of file descriptors opened at once
}

Config is a json-decoded configuration for running stenographer.

func ReadConfigFile

func ReadConfigFile(filename string) (*Config, error)

ReadConfigFile reads in the given JSON encoded configuration file and returns the Config object associated with the decoded configuration data.

func (Config) Validate

func (c Config) Validate() error

Validate checks the configuration for common errors.

type ThreadConfig

type ThreadConfig struct {
	PacketsDirectory   string
	IndexDirectory     string
	DiskFreePercentage int `json:",omitempty"`
	MaxDirectoryFiles  int `json:",omitempty"`
}

ThreadConfig is a json-decoded configuration for each stenotype thread, detailing where it should store data and how much disk space it should keep available on each disk.

Jump to

Keyboard shortcuts

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