zot: initial commit

This commit is contained in:
Ramkumar Chinchani
2019-06-20 16:36:40 -07:00
parent 967ff15637
commit 9d4e8b4594
55 changed files with 6478 additions and 2 deletions
+52
View File
@@ -0,0 +1,52 @@
package api
import (
dspec "github.com/opencontainers/distribution-spec"
)
type StorageConfig struct {
RootDirectory string
}
type TLSConfig struct {
Cert string
Key string
CACert string
}
type AuthHTPasswd struct {
Path string
}
type AuthConfig struct {
FailDelay int
HTPasswd AuthHTPasswd
}
type HTTPConfig struct {
Address string
Port string
TLS TLSConfig `mapstructure:",omitempty"`
Auth AuthConfig `mapstructure:",omitempty"`
Realm string
}
type LogConfig struct {
Level string
Output string
}
type Config struct {
Version string
Storage StorageConfig
HTTP HTTPConfig
Log LogConfig `mapstructure:",omitempty"`
}
func NewConfig() *Config {
return &Config{
Version: dspec.Version,
HTTP: HTTPConfig{Address: "127.0.0.1", Port: "8080"},
Log: LogConfig{Level: "debug"},
}
}