configuration

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpPorts

func HttpPorts(ctx context.Context) []int

func HttpServers

func HttpServers(ctx context.Context) (int, map[string][]int)

func Port

func Port(ctx context.Context) int

func Ports

func Ports(contexts []context.Context) []int

func StreamServers

func StreamServers(ctx context.Context) []int

Types

type CompletedManagerConfig

type CompletedManagerConfig struct {
	*ManagerConfig
}

func (*CompletedManagerConfig) NewNginxConfigManager

func (cc *CompletedManagerConfig) NewNginxConfigManager() (NginxConfigManager, error)

type HttpInfo

type HttpInfo struct {
	ServerCount     int
	ServerPortCount map[string][]int
	PortCount       []int
}

type ManagerConfig

type ManagerConfig struct {
	NginxMainConfigAbsPath  string
	NginxHome               string
	NginxBinFilePath        string
	RegularlyTaskCycleDelay time.Duration
	BackupCycleDays         int
	BackupRetentionDays     int
	BackupDir               string
	BackupPrefix            string
	BackupTimeZone          *time.Location
}

func (*ManagerConfig) Complete

func (c *ManagerConfig) Complete() (*CompletedManagerConfig, error)

type NginxConfig

type NginxConfig interface {
	Main() local.MainContext
	UpdateFromJsonBytes(data []byte) error
	UpdatedTimestamp() time.Time
	TextLines() []string
	Json() []byte
	Dump() map[string]*bytes.Buffer
}

func NewNginxConfigFromFS

func NewNginxConfigFromFS(filepath string) (NginxConfig, error)

func NewNginxConfigFromJsonBytes

func NewNginxConfigFromJsonBytes(data []byte) (NginxConfig, error)

type NginxConfigManager

type NginxConfigManager interface {
	Start() error
	Stop(timeout time.Duration) error
	NginxConfig() NginxConfig
	ServerStatus() v1.State
	ServerVersion() string
}

type Statistician

type Statistician interface {
	HttpInfo() HttpInfo
	StreamInfo() StreamInfo
	Statistics() *v1.Statistics
}

func NewStatistician

func NewStatistician(c NginxConfig) Statistician

type StreamInfo

type StreamInfo struct {
	PortCount []int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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