mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
zot: initial commit
This commit is contained in:
@@ -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"},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user