gitremote

package module
v0.0.0-...-11790f9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidArguments = errors.New("invalid arguments.")
View Source
var ErrUnsupportedOption = errors.New("unsupported option")

Functions

func Run

func Run(ctx context.Context, config Config) error

Types

type Capabilities

type Capabilities struct {
	Optional    Capability
	Mandatory   Capability
	Refspecs    []string
	ExportMarks string
	ImportMarks string
}

type Capability

type Capability uint
const (
	CapConnect Capability = 1 << iota
	CapPush
	CapFetch
	CapExport
	CapImport
	CapOption
	CapRefspec
	CapBidiImport
	CapExportMarks
	CapImportMarks
	CapNoPrivateUpdate
	CapCheckConnectivity
	CapSignedTags
)

func (Capability) String

func (c Capability) String() string

type CmdCapabilities

type CmdCapabilities struct {
	Config Config
}

type CmdConnect

type CmdConnect struct {
	Config  Config
	Service string
	io.Reader
	io.Writer
}

type CmdExport

type CmdExport struct {
	Config Config
	io.Reader
	io.Writer
}

type CmdFetch

type CmdFetch struct {
	Config  Config
	Objects map[string]string
}

type CmdImport

type CmdImport struct {
	Config Config
	Names  []string
	io.Reader
	io.Writer
}

type CmdList

type CmdList struct {
	Config  Config
	ForPush bool
}

type CmdOption

type CmdOption struct {
	Config Config
	Key    string
	Value  string
}

type CmdPush

type CmdPush struct {
	Config  Config
	Refs    []*PushRef
	Options []string
}

type CmdUnknown

type CmdUnknown struct {
	Config Config
	Line   string
}

type Command

type Command interface {
	// contains filtered or unexported methods
}

type Config

type Config struct {
	Helper Helper
	Dir    string
	Remote string
	URL    string
	Stdin  io.Reader
	Stdout io.Writer
	Err    error
}

func DefaultConfig

func DefaultConfig() Config

type ErrInvalidCommand

type ErrInvalidCommand string

func (ErrInvalidCommand) Error

func (e ErrInvalidCommand) Error() string

type Helper

type Helper interface {
	Capabilities() Capabilities
	SetOption(key, value string) error

	List(ctx context.Context, cmd *CmdList) ([]ListRef, error)
	Fetch(ctx context.Context, cmd *CmdFetch) error
	Push(ctx context.Context, cmd *CmdPush) error
	Export(ctx context.Context, cmd *CmdExport) error
	Import(ctx context.Context, cmd *CmdImport) error
	Connect(ctx context.Context, cmd *CmdConnect) error
	Unknown(ctx context.Context, cmd *CmdUnknown) error
}

type ListRef

type ListRef struct {
	Name string

	Hash string // sha1 hash  value
	Sym  string // @<dest> for symref

	Unchanged bool // unchanged attribute
}

type PushRef

type PushRef struct {
	Src   string
	Dst   string
	Force bool

	Ok  bool
	Err error
}

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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