git

package module
v0.0.0-...-fd29564 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHost

func ParseHost(urs string) (string, error)

ParseHost from git url string.

func SetLogger

func SetLogger(l Logger)

SetLogger sets logger for the package.

Types

type LogLevel

type LogLevel int

LogLevel ...

const (
	// DebugLevel ...
	DebugLevel LogLevel = 3
	// InfoLevel ...
	InfoLevel LogLevel = 2
	// WarnLevel ...
	WarnLevel LogLevel = 1
	// ErrLevel ...
	ErrLevel LogLevel = 0
)

func (LogLevel) String

func (l LogLevel) String() string

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warningf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
}

Logger interface used in this package.

func NewLogger

func NewLogger(lev LogLevel) Logger

NewLogger ...

type Repository

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

Repository ...

func NewRepository

func NewRepository() *Repository

NewRepository creates a new repository.

func (*Repository) Add

func (r *Repository) Add(name string) error

Add file.

func (*Repository) Clone

func (r *Repository) Clone(urs string, path string) error

Clone repository.

func (*Repository) Delete

func (r *Repository) Delete(id string) (bool, error)

Delete bytes.

func (*Repository) Exists

func (r *Repository) Exists(id string) (bool, error)

Exists ...

func (*Repository) Get

func (r *Repository) Get(id string) ([]byte, error)

Get bytes.

func (*Repository) IDs

func (r *Repository) IDs(opts ...keyring.IDsOption) ([]string, error)

IDs ...

func (*Repository) Name

func (r *Repository) Name() string

Name of git keyring.Store.

func (*Repository) Open

func (r *Repository) Open(path string) error

Open repository.

func (*Repository) Path

func (r *Repository) Path() string

Path to repo.

func (*Repository) Pull

func (r *Repository) Pull() error

Pull fetches and merges.

func (*Repository) Push

func (r *Repository) Push() error

Push changes.

func (*Repository) Remove

func (r *Repository) Remove(name string) error

Remove file.

func (*Repository) Reset

func (r *Repository) Reset() error

Reset ...

func (*Repository) Set

func (r *Repository) Set(id string, data []byte) error

Set bytes.

func (*Repository) SetKey

func (r *Repository) SetKey(key *keys.EdX25519Key) error

SetKey sets the ssh key.

func (*Repository) SetKeyringDir

func (r *Repository) SetKeyringDir(krd string)

SetKeyringDir sets the keyring subdirectory (optional).

func (*Repository) Sync

func (r *Repository) Sync() error

Sync does a pull (fetch, merge), push.

Jump to

Keyboard shortcuts

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