config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_listen_proto protoreflect.FileDescriptor

Functions

This section is empty.

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" yaml:"certificate"`
}

type Cert

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

func NewCert

func NewCert(certs []*Certificate, dir string) (*Cert, error)

func (*Cert) Get

func (c *Cert) Get(hostName string) (*tls.Certificate, bool)

Get 获取证书

func (*Cert) GetCertificate

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

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"`
	// contains filtered or unexported fields
}

func (*Certificate) Descriptor deprecated

func (*Certificate) Descriptor() ([]byte, []int)

Deprecated: Use Certificate.ProtoReflect.Descriptor instead.

func (*Certificate) GetCert

func (x *Certificate) GetCert() string

func (*Certificate) GetKey

func (x *Certificate) GetKey() string

func (*Certificate) ProtoMessage

func (*Certificate) ProtoMessage()

func (*Certificate) ProtoReflect

func (x *Certificate) ProtoReflect() protoreflect.Message

func (*Certificate) Reset

func (x *Certificate) Reset()

func (*Certificate) String

func (x *Certificate) String() string

type CertificateDir

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

type Config

type Config 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"`
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig() (*Config, error)

func (*Config) Export

func (c *Config) Export() *ListensMsg

func (*Config) Ports

func (c *Config) Ports() []int

type ListenConfig

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

type ListenMsg

type ListenMsg struct {
	Port        int32          `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"`
	Scheme      string         `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"`
	Certificate []*Certificate `protobuf:"bytes,3,rep,name=certificate,proto3" json:"certificate,omitempty"`
	// contains filtered or unexported fields
}

func (*ListenMsg) Descriptor deprecated

func (*ListenMsg) Descriptor() ([]byte, []int)

Deprecated: Use ListenMsg.ProtoReflect.Descriptor instead.

func (*ListenMsg) GetCertificate

func (x *ListenMsg) GetCertificate() []*Certificate

func (*ListenMsg) GetPort

func (x *ListenMsg) GetPort() int32

func (*ListenMsg) GetScheme

func (x *ListenMsg) GetScheme() string

func (*ListenMsg) ProtoMessage

func (*ListenMsg) ProtoMessage()

func (*ListenMsg) ProtoReflect

func (x *ListenMsg) ProtoReflect() protoreflect.Message

func (*ListenMsg) Reset

func (x *ListenMsg) Reset()

func (*ListenMsg) String

func (x *ListenMsg) String() string

type ListensMsg

type ListensMsg struct {
	Dir     string       `protobuf:"bytes,1,opt,name=dir,proto3" json:"dir,omitempty"`
	Listens []*ListenMsg `protobuf:"bytes,2,rep,name=listens,proto3" json:"listens,omitempty"`
	// contains filtered or unexported fields
}

func ReadHttpTrafficConfig

func ReadHttpTrafficConfig(r io.Reader) *ListensMsg

func (*ListensMsg) Descriptor deprecated

func (*ListensMsg) Descriptor() ([]byte, []int)

Deprecated: Use ListensMsg.ProtoReflect.Descriptor instead.

func (*ListensMsg) GetDir

func (x *ListensMsg) GetDir() string

func (*ListensMsg) GetListens

func (x *ListensMsg) GetListens() []*ListenMsg

func (*ListensMsg) ProtoMessage

func (*ListensMsg) ProtoMessage()

func (*ListensMsg) ProtoReflect

func (x *ListensMsg) ProtoReflect() protoreflect.Message

func (*ListensMsg) Reset

func (x *ListensMsg) Reset()

func (*ListensMsg) String

func (x *ListensMsg) String() string

type SSLConfig

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

Jump to

Keyboard shortcuts

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