common

package
v4.0.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package common contains interfaces and non-specific protocol entities

Index

Constants

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

Variables

View Source
var (
	ErrRepositoryNotFound    = errors.New("repository not found")
	ErrAuthorizationRequired = errors.New("authorization required")
	ErrEmptyGitUploadPack    = errors.New("empty git-upload-pack given")
	ErrInvalidAuthMethod     = errors.New("invalid auth method")
)

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 url.URL

func NewEndpoint

func NewEndpoint(endpoint string) (Endpoint, error)

func (*Endpoint) String

func (e *Endpoint) String() string

type GitUploadPackInfo

type GitUploadPackInfo struct {
	Capabilities *Capabilities
	Refs         memory.ReferenceStorage
}

func NewGitUploadPackInfo

func NewGitUploadPackInfo() *GitUploadPackInfo

func (*GitUploadPackInfo) Bytes

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

func (*GitUploadPackInfo) Decode

func (r *GitUploadPackInfo) Decode(s *pktline.Scanner) error

func (*GitUploadPackInfo) Head

func (r *GitUploadPackInfo) Head() *core.Reference

func (*GitUploadPackInfo) String

func (r *GitUploadPackInfo) String() string

type GitUploadPackRequest

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

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() error
	SetAuth(AuthMethod) error
	Info() (*GitUploadPackInfo, error)
	Fetch(*GitUploadPackRequest) (io.ReadCloser, error)
	Disconnect() error
}

Jump to

Keyboard shortcuts

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