config

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigInvalid = errors.New("config invalid")
View Source
var ErrConfigNotFound = errors.New("config not found")

Functions

func LoadConfig

func LoadConfig(path string) (*ConfigReal, *ConfigDemo, error)

LoadConfig return config, configDemo

Types

type App

type App struct {
	Paths []Path `json:"paths" toml:"paths"`
}

Read from file

type Config

type Config interface {
	Install() error
	Update() error
	Clean() error
	Diff() error
	Download() error
	Validate() error
}

type ConfigApps added in v0.13.0

type ConfigApps struct {
	Apps map[string]App `json:"apps" toml:"apps"`
}

type ConfigDemo added in v0.13.0

type ConfigDemo struct {
	ConfigApps
}

func (*ConfigDemo) Clean added in v0.13.0

func (c *ConfigDemo) Clean() error

func (*ConfigDemo) Diff added in v0.13.0

func (c *ConfigDemo) Diff() error

func (*ConfigDemo) Download added in v0.13.0

func (c *ConfigDemo) Download() error

func (*ConfigDemo) Install added in v0.13.0

func (c *ConfigDemo) Install() error

func (*ConfigDemo) Update added in v0.13.0

func (c *ConfigDemo) Update() error

func (*ConfigDemo) Validate added in v0.13.0

func (c *ConfigDemo) Validate() error

type ConfigReal added in v0.13.0

type ConfigReal struct {
	ConfigApps
	// contains filtered or unexported fields
}

func (*ConfigReal) Clean added in v0.13.0

func (c *ConfigReal) Clean() error

Clean remove unused config inside config dir

func (*ConfigReal) Diff added in v0.13.0

func (c *ConfigReal) Diff() error

func (*ConfigReal) Download added in v0.13.0

func (c *ConfigReal) Download() error

func (*ConfigReal) Install added in v0.13.0

func (c *ConfigReal) Install() error

Install internal -> external

func (*ConfigReal) Update added in v0.13.0

func (c *ConfigReal) Update() error

Update external -> internal

func (*ConfigReal) Validate added in v0.13.0

func (c *ConfigReal) Validate() error

type Path

type Path struct {
	Internal string `json:"internal" toml:"internal"`
	External string `json:"external,omitempty" toml:"external"`
	URL      string `json:"url,omitempty" toml:"url"`
}

Jump to

Keyboard shortcuts

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