config

package
v0.0.0-...-d4b3ac2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 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 {
	Rpc             *RpcConfig
	StenotypePath   string
	Threads         []ThreadConfig
	Interface       string
	TestimonySocket string
	Flags           []string
	Port            int
	Host            string // Location to listen.
	CertPath        string // Directory where client and server certs are stored.
	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 RpcConfig

type RpcConfig struct {
	CaCert              string
	ServerKey           string
	ServerCert          string
	ServerPort          int
	ServerPcapPath      string
	ServerPcapMaxSize   int64
	ClientPcapChunkSize int64
	ClientPcapMaxSize   int64
}

RpcConfig is a json-decoded configuration for running the gRPC server.

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