settings

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PreviousGroupName = "previous"
)

Variables

View Source
var (
	ErrGroupNotFound      = errors.New("group is not found")
	ErrGroupAlreadyExists = errors.New("group already exists")
	ErrRepoAlreadyExists  = errors.New("repository already exists")
	ErrRepoNotFound       = errors.New("repository is not found")
	ErrRepoNotSupported   = errors.New("repository is not supported")
	ErrRepoAlreadyAdded   = errors.New("repository already added")
	ErrRepoAlreadyRemoved = errors.New("repository already removed")
)

Functions

This section is empty.

Types

type ExportImportStatus

type ExportImportStatus int
const (
	ExportImportStatusUpToDate ExportImportStatus = iota
	ExportImportStatusAdded
	ExportImportStatusRemoved
)

type Group added in v0.2.0

type Group struct {
	Name  string   `yaml:"name"`
	Repos []string `yaml:"repos"`
}

type Manager

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

func NewManager

func NewManager(conf *config.Config, sh shell.Shell) *Manager

func (*Manager) Export

func (sm *Manager) Export(remoteRepoUrl string) (map[string]ExportImportStatus, error)

func (*Manager) Import

func (sm *Manager) Import(remoteRepoUrl string) (map[string]ExportImportStatus, error)

func (*Manager) Read

func (sm *Manager) Read() (*Settings, error)

func (*Manager) Write

func (sm *Manager) Write(settings *Settings) error

type Repo

type Repo struct {
	Name string   `yaml:"name"`
	Url  string   `yaml:"url"`
	Tags []string `yaml:"tags"`
}

type Settings

type Settings struct {
	Repos  []Repo  `yaml:"repos"`
	Groups []Group `yaml:"groups"`
}

func (*Settings) AddGroup added in v0.2.0

func (s *Settings) AddGroup(groupName string) (*Group, error)

func (*Settings) AddRepo

func (s *Settings) AddRepo(name string, url string, tags []string) error

func (*Settings) AddRepoToGroup added in v0.2.0

func (s *Settings) AddRepoToGroup(group *Group, repoName string) error

func (*Settings) GetGroup added in v0.2.0

func (s *Settings) GetGroup(groupName string) (*Group, error)

func (*Settings) GetRepo added in v0.14.0

func (s *Settings) GetRepo(name string) (*Repo, error)

func (*Settings) GroupExists added in v0.2.0

func (s *Settings) GroupExists(groupName string) bool

func (*Settings) RemoveGroup added in v0.2.0

func (s *Settings) RemoveGroup(groupName string) error

func (*Settings) RemoveRepo

func (s *Settings) RemoveRepo(name string) error

func (*Settings) RemoveRepoFromGroup added in v0.2.0

func (s *Settings) RemoveRepoFromGroup(group *Group, repoName string) error

func (*Settings) RepoExists added in v0.2.0

func (s *Settings) RepoExists(name string) bool

Jump to

Keyboard shortcuts

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