config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemPrefixDir       = "/usr/local"
	DefaultBaseDir        = "~/.nostromo"
	DefaultConfigFile     = "%s.yaml"
	DefaultManifestsDir   = "ships"
	DefaultBackupsDir     = "cargo"
	DefaultDownloadsDir   = "downloads"
	DefaultCompletionsDir = "completions"
	DefaultManDir         = "man"
)

Path for standard nostromo config

View Source
const (
	FileURLScheme = "file://"
)

URL scheme constants

Variables

This section is empty.

Functions

func BaseDir added in v0.9.0

func BaseDir() string

BaseDir returns the base directory for nostromo files

func LinkManPages added in v0.10.0

func LinkManPages() []error

LinkManPages creates a symlink for man pages

func ManDir added in v0.10.0

func ManDir() string

ManDir returns the nostromo man dir

func NewCoreManifest added in v0.9.0

func NewCoreManifest() (*model.Manifest, error)

NewCoreManifest creates a new core manifest

func NewManifest added in v0.9.1

func NewManifest(name string) *model.Manifest

NewManifest creates a new manifest with provided name

func Parse

func Parse(path string) (*model.Manifest, error)

Parse nostromo config at path into a `Manifest` object

func SaveManifest added in v0.9.1

func SaveManifest(manifest *model.Manifest, backup bool) error

SaveManifest to nostromo config folder and backup optionally

func SaveSpaceport added in v0.9.1

func SaveSpaceport(s *model.Spaceport) error

SaveSpaceport to nostromo config folder

func SetVersion added in v0.8.0

func SetVersion(v *version.Info)

SetVersion should be called before any task to ensure manifest is updated

func UnlinkManPages added in v0.10.0

func UnlinkManPages() []error

UnlinkManPages from system man dir

func WriteCompletion added in v0.9.0

func WriteCompletion(sh, s string) error

WriteCompletion writes a file to the completions folder

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config manages working with nostromo configuration files The file format is YAML this just provides convenience around converting to a manifest

func LoadConfig added in v0.9.0

func LoadConfig() (*Config, error)

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns a new nostromo config

func (*Config) DeleteManifest added in v0.9.2

func (c *Config) DeleteManifest(name string) error

DeleteManifest from nostromo manfiests folder

func (*Config) Exists

func (c *Config) Exists() bool

Exists checks if nostromo config file exists

func (*Config) Get

func (c *Config) Get(key string) string

Get setting value from config

func (*Config) Save

func (c *Config) Save() error

Save nostromo config to file

func (*Config) Set

func (c *Config) Set(key, value string) error

Set setting value for key

func (*Config) Spaceport added in v0.9.0

func (c *Config) Spaceport() *model.Spaceport

Spaceport associated with this config

func (*Config) Sync added in v0.9.0

func (c *Config) Sync(force, keep bool, sources []string) ([]*model.Manifest, error)

Sync adds a new manifest from provided sources

Jump to

Keyboard shortcuts

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