Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Properties ¶
type Properties struct {
// Registries the more front the position, the higher priority.
// You could add an empty Registry at the end to proxy all other requests
// with those origin schema and host.
Registries []*Registry `yaml:"registries"`
}
Properties holds all configurable properties of dfdaemon. The default path is '/etc/dragonfly/dfdaemon.yml' For examples:
registries:
- regx: (^localhost$)|(^127.0.0.1$)
schema: http
host: a.com
- regx: ^reg.com:1001$
schema: http
host: reg.com
- regx: ^reg.com:1002$
schema: https
host: reg.com
certs: ['/etc/ssl/reg.com/server.crt']
func NewProperties ¶
func NewProperties() *Properties
NewProperties create a new properties with default values.
func (*Properties) Load ¶
func (p *Properties) Load(path string) error
Load loads properties from config file.
type Registry ¶
type Registry struct {
// Schema can be 'http', 'https' or empty. It will use dfdaemon's schema if
// it's empty.
Schema string `yaml:"schema"`
// Host is the host of proxied registry, including ip and port.
Host string `yaml:"host"`
// Certs is the path of server-side certification. It should be provided when
// the 'Schema' is 'https' and the dfdaemon is worked on proxy pattern and
// the proxied registry is self-certificated.
// The server-side certification could be get by using this command:
// openssl x509 -in <(openssl s_client -showcerts -servername xxx -connect xxx:443 -prexit 2>/dev/null)
Certs []string `yaml:"certs"`
// Regx is a regular expression, dfdaemon use this registry to process the
// requests whose host is matched.
Regx string `yaml:"regx"`
// contains filtered or unexported fields
}
Registry is the proxied registry base information.
func NewRegistry ¶
NewRegistry create and init registry proxy with the giving values.
Click to show internal directories.
Click to hide internal directories.