config

package
v0.0.0-...-182226c Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrUpdate

func AddOrUpdate(item ConfigItem) error

func Save

func Save(config *Config) error

Types

type Config

type Config struct {
	Items []ConfigItem `json:"items,omitempty"`
}

func Load

func Load() (*Config, error)

func (*Config) AddOrUpdate

func (c *Config) AddOrUpdate(item ConfigItem) error

func (*Config) Get

func (c *Config) Get(repoName string) *ConfigItem

type ConfigItem

type ConfigItem struct {
	Name       string `json:"name,omitempty"`
	Version    string `json:"version,omitempty"`
	Checksum   string `json:"checksum,omitempty"`
	Executable string `json:"executable,omitempty"`
}

func (*ConfigItem) Owner

func (i *ConfigItem) Owner() string

Owner returns the owner part of the item's Name

func (*ConfigItem) Repository

func (i *ConfigItem) Repository() string

Repository returns the repo part of the item's Name

Jump to

Keyboard shortcuts

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