gitremote

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: BSD-4-Clause, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlreadyExistErr = errors.New("remote already exists")

Functions

This section is empty.

Types

type Config

type Config struct {
	Path string
}

func New

func New(path string) *Config

func (*Config) Add

func (config *Config) Add(r *Remote) error

func (*Config) AddOrUpdate

func (config *Config) AddOrUpdate(r *Remote) error

func (*Config) Content

func (config *Config) Content() (string, error)

func (*Config) Delete

func (config *Config) Delete(r *Remote) error

func (*Config) List

func (config *Config) List() (Remotes, error)

func (*Config) Update

func (config *Config) Update(r *Remote) error

func (*Config) Write

func (config *Config) Write(content string) error

type ConfigFileError

type ConfigFileError struct {
	Err error
}

func (*ConfigFileError) Error

func (err *ConfigFileError) Error() string

type Remote

type Remote struct {
	Name  string
	URL   string
	Fetch string
}

func (*Remote) Host

func (r *Remote) Host() string

func (*Remote) Repository

func (r *Remote) Repository() string

func (*Remote) ToConfig

func (r *Remote) ToConfig() (string, error)

type Remotes

type Remotes []*Remote

func List

func List(path string) (Remotes, error)

List returns the list of the remote for the GIT repository defined by path.

func ListFromConfigContent

func ListFromConfigContent(content string) (Remotes, error)

func (Remotes) FilterByHost

func (remotes Remotes) FilterByHost(host string) Remotes

func (Remotes) FilterByName

func (remotes Remotes) FilterByName(name string) Remotes

func (Remotes) FilterByNamePrefix

func (remotes Remotes) FilterByNamePrefix(prefix string) Remotes

func (Remotes) Hosts

func (remotes Remotes) Hosts() []string

Jump to

Keyboard shortcuts

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