gitrepo

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepoDefaultCtx = "default"
)

Variables

View Source
var (
	ErrNotFound     = errors.New("given alias doesn't exist")
	ErrLoadCfgFile  = errors.New("failed to load config file")
	ErrOverwriteCfg = errors.New("cannot overwrite config file")
)

Functions

func AliasExists

func AliasExists(repoList []RepoCtx, targetAlias string) bool

func GetRepoCfgPath added in v0.10.0

func GetRepoCfgPath() (string, error)

func GetRepoUrl

func GetRepoUrl(repoAlias string) (string, error)

func ReadDefaultConfig

func ReadDefaultConfig() (*os.File, error)

func StoreRepoCfg

func StoreRepoCfg(writer io.Writer, data []byte) error

func TruncateFile

func TruncateFile(file *os.File) error

Types

type RepoCtx

type RepoCtx struct {
	Url   string `json:"url,omitempty"`
	Alias string `json:"alias,omitempty"`
}

type RepoCtxCfg

type RepoCtxCfg struct {
	Default RepoCtx   `json:"default,omitempty"`
	Repos   []RepoCtx `json:"repos,omitempty"`
}

func LoadRepoCfg

func LoadRepoCfg(reader io.Reader) (RepoCtxCfg, error)

Jump to

Keyboard shortcuts

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