config

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = &Config{
		Proxy:             EmptyProxy,
		Storage:           EmptyStorage,
		Registry:          EmptyRegistry,
		LegacyVersionFile: EmptyLegacyVersionFile,
		Cache:             EmptyCache,
	}
)
View Source
var (
	EmptyCache = &Cache{
		AvailableHookDuration: CacheDuration(12 * time.Hour),
	}
)
View Source
var EmptyLegacyVersionFile = &LegacyVersionFile{
	Enable: false,
}
View Source
var (
	EmptyProxy = &Proxy{
		Url:    "",
		Enable: false,
	}
)
View Source
var EmptyRegistry = &Registry{
	Address: "",
}
View Source
var EmptyStorage = &Storage{
	SdkPath: "",
}

Functions

This section is empty.

Types

type Cache added in v0.5.0

type Cache struct {
	AvailableHookDuration CacheDuration `yaml:"availableHookDuration"` // Available hook result cache time
}

Cache is the cache configuration

type CacheDuration added in v0.5.0

type CacheDuration time.Duration

CacheDuration is a duration that represents the cache duration and some special values -1: never expire 0: never cache

func (CacheDuration) MarshalYAML added in v0.5.0

func (d CacheDuration) MarshalYAML() (interface{}, error)

func (CacheDuration) String added in v0.5.0

func (d CacheDuration) String() string

func (*CacheDuration) UnmarshalYAML added in v0.5.0

func (d *CacheDuration) UnmarshalYAML(node *yaml.Node) error

type Config

type Config struct {
	Proxy             *Proxy             `yaml:"proxy"`
	Storage           *Storage           `yaml:"storage"`
	Registry          *Registry          `yaml:"registry"`
	LegacyVersionFile *LegacyVersionFile `yaml:"legacyVersionFile"`
	Cache             *Cache             `yaml:"cache"`
}

func NewConfig

func NewConfig(path string) (*Config, error)

func NewConfigWithPath

func NewConfigWithPath(p string) (*Config, error)

func (*Config) SaveConfig added in v0.4.0

func (c *Config) SaveConfig(path string) error

type LegacyVersionFile added in v0.4.0

type LegacyVersionFile struct {
	Enable bool `yaml:"enable"`
}

LegacyVersionFile represents whether to enable the ability to parse legacy version files, Disable by default.

type Proxy

type Proxy struct {
	Url    string `yaml:"url"`
	Enable bool   `yaml:"enable"`
}

type Registry added in v0.3.0

type Registry struct {
	Address string `yaml:"address"`
}

type Storage added in v0.2.3

type Storage struct {
	SdkPath string `yaml:"sdkPath"`
}

func (*Storage) Validate added in v0.2.3

func (s *Storage) Validate() error

Jump to

Keyboard shortcuts

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