config

package
v0.0.0-...-444b592 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StubRouterConfig

type StubRouterConfig struct {
	Server struct {
		Host string `short:"h" long:"host" default:"0.0.0.0" description:"Listen host address"`
		Port int    `short:"p" long:"port" default:"3333" description:"Listen host port"`
	} `group:"server" namespace:"server"`

	Session struct {
		Duration    string `long:"duration" default:"24h" description:"Session duration in time.Duration format"`
		IdleTimeout string `long:"idle-timeout" default:"0h" description:"Session idle in time.Duration format"`
		CookieName  string `long:"cookie-name" default:"sessid" description:"Session cookie name"`
	} `group:"session" namespace:"session"`

	Auth struct {
		Enabled     bool   `long:"enabled" description:"Enable auth"`
		UseridField string `long:"user-field" description:"Auth user field in JWT token"`
	} `group:"auth" namespace:"auth"`

	Targets map[string]string `short:"t" long:"target" description:"Target pair target_path:target_host"`

	StubsStorage struct {
		Type  string `long:"type" default:"file" description:"Stub storage type: file, redis"`
		Path  string `long:"path" default:"." description:"Stub storage path: FS path, redis connect string"`
		Cache struct {
			Enabled            bool   `long:"enabled" description:"Cache stub in memory"`
			ExpirationInterval string `long:"expiration-interval" default:"30m" description:"Stub lifetime in cache"`
			CleanupInterval    string `long:"cleanup-interval" default:"60m" description:"Remove stub from cache after"`
		} `group:"cache" namespace:"cache"`
	} `group:"stubs" namespace:"stubs"`
}

func ParseConfig

func ParseConfig() (StubRouterConfig, error)

Jump to

Keyboard shortcuts

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