manager

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name       string            `json:"name"`
	Email      string            `json:"email"`
	Repository map[string]string `json:"Repository"`
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(path string) (Config, error)

func (*Config) AddRepository

func (c *Config) AddRepository(name string, url string) error

func (Config) CheckRepository

func (c Config) CheckRepository(name string) bool

func (Config) Load

func (c Config) Load(path string) (Config, error)

func (*Config) RemoveRepository added in v0.1.2

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

func (Config) Save

func (c Config) Save() error

func (*Config) SetPath

func (c *Config) SetPath(lPath string)

type GitHelper

type GitHelper struct {
	Path   string
	Config Config
}

func CreateGit

func CreateGit(config Config) GitHelper

func (GitHelper) Clone

func (g GitHelper) Clone(name string, url string) error

func (GitHelper) Commit

func (g GitHelper) Commit(repoName string) error

func (GitHelper) CommitAndPush

func (g GitHelper) CommitAndPush(repoName string) error

func (GitHelper) Pull added in v0.1.3

func (g GitHelper) Pull(repoName string) error

func (GitHelper) Push

func (g GitHelper) Push(repoName string) error

func (GitHelper) Remove

func (g GitHelper) Remove(repoName string, path string) error

type Index

type Index struct {
	Index    map[string]string `json:"index"`
	Path     string            `json:"-"`
	RepoName string            `json:"-"`
	// contains filtered or unexported fields
}

func (*Index) Add

func (I *Index) Add(path string) (string, error)

func (Index) CheckFile

func (I Index) CheckFile(id string) bool

func (Index) ContainPath

func (I Index) ContainPath(path string) (string, bool)

func (*Index) Remove

func (I *Index) Remove(id string) error

type Mover

type Mover struct {
	Config Config
	Git    GitHelper
	Path   string
	Index  map[string]Index
}

func CreateMover

func CreateMover(config Config, git GitHelper) Mover

func (Mover) Add

func (m Mover) Add(path string, repoName string) error

func (Mover) List

func (m Mover) List(repoName string) (map[string]string, error)

func (Mover) Remove

func (m Mover) Remove(id string) (string, error)

func (Mover) RemoveFromRepository added in v0.1.1

func (m Mover) RemoveFromRepository(repoName string, id string) error

func (Mover) Restore

func (m Mover) Restore(repoName string) []error

func (Mover) RestoreFile

func (m Mover) RestoreFile(repoName string, id string) error

func (Mover) Update

func (m Mover) Update(repoName string) []error

Jump to

Keyboard shortcuts

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