config

package
v0.0.0-...-03a43c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddress

func GetAddress() string

Types

type Client

type Client struct {
	Name string `yaml:"name"`
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type Config

type Config struct {
	Host         string
	Port         int
	InstanceType InstanceType
}

func GetFlags

func GetFlags() Config

type ConfigFile

type ConfigFile struct {
	Config struct {
		Servers []Server `yaml:"servers"`
		Clients []Client `yaml:"clients"`
	} `yaml:"config"`
}

func GetConfig

func GetConfig() ConfigFile

type InstanceType

type InstanceType int
const (
	InstanceTypeClient InstanceType = iota
	InstanceTypeServer
	InstanceTypeLoadBalancer
)

func (*InstanceType) Set

func (i *InstanceType) Set(s string) error

func (InstanceType) String

func (i InstanceType) String() string

type Server

type Server struct {
	Name string `yaml:"name"`
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

Jump to

Keyboard shortcuts

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