gitaly

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBranch = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientPool

type ClientPool interface {
	Dial(ctx context.Context, address, token string) (*grpc.ClientConn, error)
}

ClientPool abstracts gitlab.com/gitlab-org/gitaly/client.Pool.

type PollInfo added in v0.0.5

type PollInfo struct {
	UpdateAvailable bool
	CommitId        string
}

type Poller added in v0.0.5

type Poller struct {
	GitalyPool PoolInterface
}

Poller does the following: - polls ref advertisement for updates to the repository - detects which is the main branch, if branch or tag name is not specified - compares the commit id the branch or tag is referring to with the last processed one - returns the information about the change

func (*Poller) Poll added in v0.0.5

func (p *Poller) Poll(ctx context.Context, gInfo *api.GitalyInfo, repo *gitalypb.Repository, lastProcessedCommitId, refName string) (*PollInfo, error)

Poll performs a poll on the repository. revision can be a branch name or a tag.

type Pool

type Pool struct {
	ClientPool ClientPool
}

func (*Pool) CommitServiceClient

func (p *Pool) CommitServiceClient(ctx context.Context, gInfo *api.GitalyInfo) (gitalypb.CommitServiceClient, error)

func (*Pool) SmartHTTPServiceClient added in v0.0.5

func (p *Pool) SmartHTTPServiceClient(ctx context.Context, gInfo *api.GitalyInfo) (gitalypb.SmartHTTPServiceClient, error)

type PoolInterface added in v0.0.5

type PoolInterface interface {
	CommitServiceClient(context.Context, *api.GitalyInfo) (gitalypb.CommitServiceClient, error)
	SmartHTTPServiceClient(context.Context, *api.GitalyInfo) (gitalypb.SmartHTTPServiceClient, error)
}

type Reference added in v0.0.5

type Reference struct {
	// Oid is the object ID the reference points to
	Oid string
	// Name of the reference. The name will be suffixed with ^{} in case
	// the reference is the peeled commit.
	Name string
}

Reference as used by the reference discovery protocol

type ReferenceDiscovery added in v0.0.5

type ReferenceDiscovery struct {
	// FirstPacket tracks the time when the first pktline was received
	FirstPacket time.Time
	// LastPacket tracks the time when the last pktline was received
	LastPacket time.Time
	// PayloadSize tracks the size of all pktlines' data
	PayloadSize int64
	// Packets tracks the total number of packets consumed
	Packets int
	// Refs contains all announced references
	Refs []Reference
	// Caps contains all supported capabilities
	Caps []string
}

ReferenceDiscovery contains information about a reference discovery session.

func ParseReferenceDiscovery added in v0.0.5

func ParseReferenceDiscovery(body io.Reader) (ReferenceDiscovery, error)

ParseReferenceDiscovery parses a client's reference discovery stream and returns either information about the reference discovery or an error in case it couldn't make sense of the client's request.

func (*ReferenceDiscovery) Parse added in v0.0.5

func (d *ReferenceDiscovery) Parse(body io.Reader) error

Parse parses a client's reference discovery stream into the given ReferenceDiscovery struct or returns an error in case it couldn't make sense of the client's request.

Expected protocol: - "# service=git-upload-pack\n" - FLUSH - "<OID> <ref>\x00<capabilities>\n" - "<OID> <ref>\n" - ... - FLUSH

Directories

Path Synopsis
Package mock_gitalypool is a generated GoMock package.
Package mock_gitalypool is a generated GoMock package.

Jump to

Keyboard shortcuts

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