config

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagSpeed     = "speed"
	FlagLogLevel  = "log-level"
	FlagLogFormat = "log-format"

	FlagPrefixSSH    = "ssh"
	FlagPrefixTelnet = "telnet"
	FlagPrefixAPI    = "api"
	FlagEnabled      = "-enabled"
	FlagAddress      = "-address"

	FlagSSHHostKeyPath = FlagPrefixSSH + "-host-key"
	FlagSSHHostKeyData = FlagPrefixSSH + "-host-key-data"

	FlagConcurrentStreams = "concurrent-streams"
	FlagTimeout           = "timeout"
	FlagIdleTimeout       = "idle-timeout"
	FlagMaxTimeout        = "max-timeout"
)
View Source
const EnvPrefix = "ASCII_MOVIE_"

Variables

This section is empty.

Functions

func EnvName

func EnvName(name string) string

func InitLog

func InitLog(w io.Writer, level slogx.Level, format slogx.Format)

func NewContext

func NewContext(ctx context.Context, conf *Config) context.Context

Types

type API

type API struct {
	Listener
}

type Config

type Config struct {
	Speed     float64
	LogLevel  slogx.Level
	LogFormat slogx.Format

	Server Server
}

func FromContext

func FromContext(ctx context.Context) (*Config, bool)

func Load

func Load(cmd *cobra.Command) (*Config, error)

func New

func New() *Config

func (*Config) InitLog

func (c *Config) InitLog(w io.Writer)

func (*Config) RegisterPlayFlags

func (c *Config) RegisterPlayFlags(cmd *cobra.Command)

func (*Config) RegisterRootFlags

func (c *Config) RegisterRootFlags(cmd *cobra.Command)

type ContextKey

type ContextKey uint8
const (
	URLContextKey ContextKey
)

type Listener

type Listener struct {
	Enabled bool
	Address string
}

type SSH

type SSH struct {
	Listener
	HostKeyPath []string
	HostKeyPEM  []string
}

type Server

type Server struct {
	ConcurrentStreams uint
	IdleTimeout       time.Duration
	MaxTimeout        time.Duration

	SSH    SSH
	Telnet Telnet
	API    API
}

func (*Server) RegisterFlags

func (s *Server) RegisterFlags(cmd *cobra.Command)

type Telnet

type Telnet struct {
	Listener
}

Jump to

Keyboard shortcuts

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