config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(path string)

InitConfig init Config

Types

type Config

type Config struct {
	Server *Server `json:"server,omitempty" yaml:"server,omitempty"`
}
var Cfg *Config

type Json

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

func (Json) Decode

func (j Json) Decode() (*Config, error)

func (Json) Encode

func (j Json) Encode(c *Config) error

type LoadConfig

type LoadConfig interface {
	Decode() (*Config, error)
	Encode(*Config) error
}

type Medata

type Medata struct {
	Tls          *TlsConfig    `json:"tls,omitempty" yaml:"tls,omitempty"`
	GraceTimeOut time.Duration `json:"grace_time_out,omitempty" yaml:"grace_time_out,omitempty"`

	Name   string `json:"name,omitempty" yaml:"name,omitempty"`
	Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
	Port   int    `json:"port,omitempty" yaml:"port,omitempty"`
}

type Server

type Server struct {
	Medata []*Medata `json:"medata,omitempty" yaml:"medata,omitempty"`
}

type TlsConfig

type TlsConfig struct {
	Cert ptls.FileOrContent `json:"cert,omitempty" yaml:"cert,omitempty"`
	Key  ptls.FileOrContent `json:"key,omitempty" yaml:"key,omitempty"`
}

type Yml

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

func (Yml) Decode

func (y Yml) Decode() (*Config, error)

func (Yml) Encode

func (y Yml) Encode(c *Config) error

Directories

Path Synopsis
Package dynamic
Package dynamic

Jump to

Keyboard shortcuts

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