config

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Example
fmt.Println(getIps())
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatListenUrl added in v0.8.1

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

func GetListens added in v0.8.1

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 added in v0.8.0

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 added in v0.8.1

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 added in v0.8.1

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

type NConfig added in v0.8.1

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 added in v0.8.1

func Load() NConfig

type OConfig added in v0.8.1

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 added in v0.8.1

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

type VersionConfig added in v0.8.1

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