config

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProxyGateway `mapstructure:"proxy"`
	GrpcProxy    `mapstructure:"grpc"`
	StaticServer `mapstructure:"static_server"`
}

Config the main struct that define all elements inside `goproxy.yaml`

func LoadConfig

func LoadConfig(path, name string) (config Config, err error)

LoadConfig load the config file from `path` and `name`

func (*Config) CreateSettingFile

func (c *Config) CreateSettingFile(setingFile string)

CreateSettingFile create a setting file if it doesn`t exits

type GrpcEndpoint added in v0.4.0

type GrpcEndpoint struct {
	Name    string `mapstructure:"name"`
	HostURI string `mapstructure:"host_uri"`
}

type GrpcProxy added in v0.4.0

type GrpcProxy struct {
	Listener       string         `mapstructure:"listener_grpc"`
	GrpcEndpoints  []GrpcEndpoint `mapstructure:"endpoints_grpc"`
	GrpcSSL        OptionSSL      `mapstructure:"ssl_grpc"`
	GrpcClientCert string         `mapstructure:"client_crt"`
}

GrpcProxy ...

type OptionSSL

type OptionSSL struct {
	Enable  bool   `mapstructure:"enable"`
	SSLPort int    `mapstructure:"ssl_port"`
	CrtFile string `mapstructure:"crt_file"`
	KeyFile string `mapstructure:"key_file"`
}

OptionSSL struct for the ssl options

type ProxyCache

type ProxyCache struct {
	Engine string `mapstructure:"engine"`
	Key    string `mapstructure:"key"`
}

ProxyCache struct for cache options object

type ProxyGateway

type ProxyGateway struct {
	Host              string                 `mapstructure:"host_proxy"`
	Port              int                    `mapstructure:"port_proxy"`
	PortExporterProxy int                    `mapstructure:"port_exporter_proxy"`
	ProxySSL          OptionSSL              `mapstructure:"ssl_proxy"`
	ProxySecurity     ProxySecurity          `mapstructure:"security"`
	ProxyCache        ProxyCache             `mapstructure:"cache_proxy"`
	EnpointsProxy     []domain.ProxyEndpoint `mapstructure:"services_proxy"`
}

ProxyGateway struct for the proxy gateway object

type ProxySecurity

type ProxySecurity struct {
	Type string `mapstructure:"type"`
}

ProxySecurity struct for security object

type StaticServer

type StaticServer struct {
	Host       string    `mapstructure:"host_server"`
	Port       int       `mapstructure:"port_server"`
	StaticFile string    `mapstructure:"static_files"`
	ServerSSL  OptionSSL `mapstructure:"ssl_server"`
}

StaticServer struct for the static server obeject

Jump to

Keyboard shortcuts

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