config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Root    string   `json:"root"`
	Sources []Source `json:"sources"`
	TmpDir  string   `json:"tmpdir"`
	Noop    bool     `json:"noop"`
}

Config defines a set of sources and associated metadata

func NewConfig

func NewConfig(file string) (Config, error)

NewConfig loads a config from a given file or the default location

func (*Config) GetRoot

func (c *Config) GetRoot() (string, error)

GetRoot parses the root location for copying

func (*Config) GetTmpDir

func (c *Config) GetTmpDir() (string, error)

GetTmpDir parses the tmpdir for managing source repos

func (*Config) Sync

func (c *Config) Sync() error

Sync updates a config set of sources

type Source

type Source struct {
	URL    string   `json:"url"`
	Name   string   `json:"name"`
	Ignore []string `json:"ignore"`
}

Source defines a repo to pull files from

func (*Source) GetName

func (s *Source) GetName() string

GetName parses the name for a source

func (*Source) Sync

func (s *Source) Sync(c *Config) error

Sync updates a single source

Jump to

Keyboard shortcuts

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