gitup

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 10 Imported by: 0

README

gitup

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RepoConfig RepoConfig `json:"repo"`
	GitConfig  GitConfig  `json:"git"`
	Cwd        string     `json:"cwd"`
}

Config - config represent config.json

func LoadConfig

func LoadConfig(filepath *string) (*Config, error)

LoadConfig - Load config

type Git

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

Git represent a set of git commands to one git repository and one local path

func NewGit

func NewGit(logger base.Logger, url, path *string, bare *bool) *Git

NewGit - Init a new Git instance

func (*Git) Clone

func (g *Git) Clone() error

Clone - clone a new git repository

func (*Git) Sync

func (g *Git) Sync() error

Sync - Sync a git repository, clone if is a new one, update otherwise

func (*Git) Update

func (g *Git) Update() error

Update - update a git repository

type GitConfig

type GitConfig struct {
	Bare   bool     `json:"bare"`
	Groups []string `json:"groups,omitempty"`
}

GitConfig - git setion of config.json

type Repo

type Repo struct {
	URL      string
	Name     string
	Group    string
	FullPath string
}

Repo represent a repository

type RepoConfig

type RepoConfig struct {
	Type  string `json:"type"`
	Host  string `json:"host"`
	Token string `json:"token"`
}

RepoConfig - repo setion of config.json

type RepoHub

type RepoHub interface {
	Projects() []*Repo

	ProjectsByGroup(group *string) ([]*Repo, error)
}

RepoHub represent a hub of all repositories

type Runner

type Runner struct {
	Hub    RepoHub
	Git    GitConfig
	Cwd    string
	Logger base.Logger
}

Runner -

func (*Runner) Execute

func (r *Runner) Execute()

Execute -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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