config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfigs

func ReadConfigs(dir string) (cfg Config, lockFile *LockFile, err error)

func WriteLockfile

func WriteLockfile(lockFile *LockFile, dir string) (err error)

Types

type Config

type Config struct {
	Package      Package `toml:"package"`
	Dependencies map[string]Dependency
}

func ParseConfig

func ParseConfig(r io.Reader) (cfg Config, err error)

func ReadConfig

func ReadConfig(location string) (cfg Config, err error)

func (Config) LoadValueToDependency

func (cfg Config) LoadValueToDependency(val string) string

LoadValueToDependency takes the string from a `load()` statement and returns the matching dependency in this config, if there is one

func (Config) Render

func (cfg Config) Render(w io.Writer)

type Dependency

type Dependency struct {
	Version string
	Path    string
}

func (*Dependency) UnmarshalTOML

func (c *Dependency) UnmarshalTOML(data interface{}) error

type LockFile

type LockFile struct {
	URLHashes map[string]string
	// contains filtered or unexported fields
}

func (*LockFile) AddEntry

func (l *LockFile) AddEntry(k, v string) error

func (*LockFile) LookupEntry

func (l *LockFile) LookupEntry(k string) (v string, found bool)

type Package

type Package struct {
	Name          string   `toml:"name"`
	Version       string   `toml:"version"`
	ReadOnlyPaths []string `toml:"read_only_paths"`
	HiddenPaths   []string `toml:"hidden_paths"`
}

Jump to

Keyboard shortcuts

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