common

package
v2.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package common contains utils used by the clients

Index

Constants

View Source
const GitUploadPackServiceName = "git-upload-pack"

Variables

View Source
var (
	NotFoundErr           = errors.New("repository not found")
	EmptyGitUploadPackErr = errors.New("empty git-upload-pack given")
)

Functions

This section is empty.

Types

type AuthMethod

type AuthMethod interface {
	Name() string
	String() string
}

type Capabilities

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

Capabilities contains all the server capabilities https://github.com/git/git/blob/master/Documentation/technical/protocol-capabilities.txt

func NewCapabilities

func NewCapabilities() *Capabilities

NewCapabilities returns a new Capabilities struct

func (*Capabilities) Add

func (c *Capabilities) Add(capability string, values ...string)

Add adds a capability, values are optional

func (*Capabilities) Decode

func (c *Capabilities) Decode(raw string)

Decode decodes a string

func (*Capabilities) Get

func (c *Capabilities) Get(capability string) *Capability

Get returns the values for a capability

func (*Capabilities) Set

func (c *Capabilities) Set(capability string, values ...string)

Set sets a capability removing the values

func (*Capabilities) String

func (c *Capabilities) String() string

func (*Capabilities) Supports

func (c *Capabilities) Supports(capability string) bool

Supports returns true if capability is present

func (*Capabilities) SymbolicReference

func (c *Capabilities) SymbolicReference(sym string) string

SymbolicReference returns the reference for a given symbolic reference

type Capability

type Capability struct {
	Name   string
	Values []string
}

Capability represents a server capability

type Endpoint

type Endpoint string

func NewEndpoint

func NewEndpoint(url string) (Endpoint, error)

func (Endpoint) Service

func (e Endpoint) Service(name string) string

type GitUploadPackInfo

type GitUploadPackInfo struct {
	Capabilities *Capabilities
	Head         core.Hash
	Refs         map[string]core.Hash
}

func NewGitUploadPackInfo

func NewGitUploadPackInfo() *GitUploadPackInfo

func (*GitUploadPackInfo) Bytes

func (r *GitUploadPackInfo) Bytes() []byte

func (*GitUploadPackInfo) Decode

func (r *GitUploadPackInfo) Decode(d *pktline.Decoder) error

func (*GitUploadPackInfo) String

func (r *GitUploadPackInfo) String() string

type GitUploadPackRequest

type GitUploadPackRequest struct {
	Wants []core.Hash
	Haves []core.Hash
}

func (*GitUploadPackRequest) Have

func (r *GitUploadPackRequest) Have(h ...core.Hash)

func (*GitUploadPackRequest) Reader

func (r *GitUploadPackRequest) Reader() *strings.Reader

func (*GitUploadPackRequest) String

func (r *GitUploadPackRequest) String() string

func (*GitUploadPackRequest) Want

func (r *GitUploadPackRequest) Want(h ...core.Hash)

type GitUploadPackService

type GitUploadPackService interface {
	Connect(url Endpoint) error
	ConnectWithAuth(url Endpoint, auth AuthMethod) error
	Info() (*GitUploadPackInfo, error)
	Fetch(r *GitUploadPackRequest) (io.ReadCloser, error)
}

Jump to

Keyboard shortcuts

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