config

package
v1.15.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Example
fmt.Println(getIps())
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatListenUrl

func FormatListenUrl(urls ...string) []string

func GetListens

func GetListens(ucs ...ListenUrl) []string

Types

type AdminConfig

type AdminConfig struct {
	Scheme      string       `json:"scheme" yaml:"scheme"`
	Listen      int          `json:"listen" yaml:"listen"`
	IP          string       `json:"ip" yaml:"ip"`
	Certificate *Certificate `json:"certificate,omitempty" yaml:"certificate"`
}

type Cert

type Cert struct {
	// contains filtered or unexported fields
}

func LoadCert

func LoadCert(certs []CertConfig, dir string) (*Cert, error)

func NewCert

func NewCert(certs map[string]*tls.Certificate) *Cert

func (*Cert) GetCertificate

func (c *Cert) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error)

type CertConfig

type CertConfig struct {
	Cert string `json:"cert" yaml:"cert"`
	Key  string `json:"key" yaml:"key"`
}

type Certificate

type Certificate struct {
	Key  string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"`
}

type CertificateDir

type CertificateDir struct {
	Dir string `json:"dir" yaml:"dir"`
}

type ListenConfig

type ListenConfig struct {
	Port        int            `json:"port" yaml:"port"`
	Certificate []*Certificate `json:"certificate" yaml:"certificate,omitempty"`
}

type ListenUrl

type ListenUrl struct {
	ListenUrls    []string `json:"listen_urls" yaml:"listen_urls"`
	AdvertiseUrls []string `json:"advertise_urls,omitempty" yaml:"advertise_urls,omitempty"`
}

type NConfig

type NConfig struct {
	Version        int             `json:"version" yaml:"version"`
	CertificateDir *CertificateDir `json:"certificate" yaml:"certificate"`
	Peer           UrlConfig       `json:"peer"`
	Client         UrlConfig       `json:"client"`
	Gateway        ListenUrl       `json:"gateway" yaml:"gateway"`
}

func Load

func Load() NConfig

type OConfig

type OConfig struct {
	Listen         []int           `json:"listen" yaml:"listen"`
	SSL            *SSLConfig      `json:"ssl" yaml:"ssl"`
	Admin          *AdminConfig    `json:"admin" yaml:"admin"`
	CertificateDir *CertificateDir `json:"certificate" yaml:"certificate"`
}

type SSLConfig

type SSLConfig struct {
	Listen []*ListenConfig `json:"listen"`
}

type UrlConfig

type UrlConfig struct {
	ListenUrl
	Certificate []CertConfig `json:"certificate,omitempty" yaml:"certificate,omitempty"`
}

type VersionConfig

type VersionConfig struct {
	Version int `json:"version" yaml:"version"`
}

Jump to

Keyboard shortcuts

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