mirror of
https://github.com/crazy-max/diun.git
synced 2025-04-11 06:01:21 +00:00

* Fix build workflow * Docs website with mkdocs (#99) * Fix docs workflow * Move mkdocs Docker file * Ignore docs in build workflow * Update workflows * Update links * Move upgrade notes to documentation Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/crazy-max/diun/v4/pkg/utl"
|
|
)
|
|
|
|
// RegOpts holds registry options configuration
|
|
type RegOpts struct {
|
|
Username string `yaml:"username,omitempty" json:"username,omitempty" validate:"omitempty"`
|
|
UsernameFile string `yaml:"usernameFile,omitempty" json:"usernameFile,omitempty" validate:"omitempty,file"`
|
|
Password string `yaml:"password,omitempty" json:"password,omitempty" validate:"omitempty"`
|
|
PasswordFile string `yaml:"passwordFile,omitempty" json:"passwordFile,omitempty" validate:"omitempty,file"`
|
|
InsecureTLS *bool `yaml:"insecureTLS,omitempty" json:"insecureTLS,omitempty" validate:"required"`
|
|
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty" validate:"required"`
|
|
}
|
|
|
|
// GetDefaults gets the default values
|
|
func (s *RegOpts) GetDefaults() *RegOpts {
|
|
n := &RegOpts{}
|
|
n.SetDefaults()
|
|
return n
|
|
}
|
|
|
|
// SetDefaults sets the default values
|
|
func (s *RegOpts) SetDefaults() {
|
|
s.InsecureTLS = utl.NewFalse()
|
|
s.Timeout = utl.NewDuration(10 * time.Second)
|
|
}
|