cmd

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package cmd contains CLI commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, configFile string) error

Serve runs a command to start the server - uses provided context to shut down server when context is done.

Types

type Config

type Config struct {
	Port                int    `yaml:"port"`
	KeyLength           int    `yaml:"key_length"`
	CertificateLifeDays int    `yaml:"cert_life_days"`
	LogLevel            string `yaml:"log_level"`
}

Config is used to hold application configuration values.

func LoadConfig

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

LoadConfig reads the given YAML file and loads config from it

func (*Config) GetCertificateDuration

func (c *Config) GetCertificateDuration() time.Duration

GetCertificateDuration returns the cert lifetime duration.

func (Config) String

func (c Config) String() string

String returns a string representation of config.

Jump to

Keyboard shortcuts

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