config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_NAME = "noop-server"
View Source
const DEFAULT_RECORD_FORMAT = "noop-client"
View Source
const DEFAULT_RECORD_TARGET = "record.txt"
View Source
const DEFAULT_RECORD_TARGET_APPEND = ".bak"

Variables

View Source
var DEFAULT_MAX_PROCS = int(math.Round(float64(runtime.NumCPU() / 2.0)))
View Source
var VALID_RECORD_FORMATS = []string{
	DEFAULT_RECORD_FORMAT,
	"json",
	"yaml",
	"csv",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	App  string
	Port string
	Addr string

	CertPrivatePath string
	CertKeyPath     string
	CertCAPath      string

	Verbose bool

	StreamRecord bool
	Record       bool
	RecordTarget string

	NProcs int

	Sleep time.Duration
	Echo  bool

	Script string
	// contains filtered or unexported fields
}

func Init

func Init(args []string, ver string) (*Config, error)

func (Config) Listener

func (c Config) Listener() string

func (Config) MTLSEnabled

func (c Config) MTLSEnabled() bool

func (Config) MaxProcs added in v1.4.0

func (c Config) MaxProcs() int

func (Config) RecordFile added in v1.3.0

func (c Config) RecordFile() (*os.File, error)

Create RecordTarget file, if Record is configured. If it already exists, back up the old one.

This returned 'os.File' must be closed when you're done with it.

func (*Config) RecordFormatter added in v1.3.3

func (c *Config) RecordFormatter() formatter.RecordsFormatter

This function assigns the formatter.RecordsFormatter interface based on what is selected via the CLI.

func (Config) Recording added in v1.3.0

func (c Config) Recording() bool

func (Config) TLSEnabled

func (c Config) TLSEnabled() bool

func (Config) ToString

func (c Config) ToString() string

Jump to

Keyboard shortcuts

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