go-git.v4: gopkg.in/src-d/go-git.v4/plumbing/transport/server Index | Files

package server

import "gopkg.in/src-d/go-git.v4/plumbing/transport/server"

Package server implements the git server protocol. For most use cases, the transport-specific implementations should be used.

Index

Package Files

loader.go server.go

Variables

var DefaultLoader = NewFilesystemLoader(osfs.New(""))

DefaultLoader is a filesystem loader ignoring host and resolving paths to /.

var DefaultServer = NewServer(DefaultLoader)
var (
    ErrUpdateReference = errors.New("failed to update ref")
)

func NewClient Uses

func NewClient(loader Loader) transport.Transport

NewClient returns a transport.Transport implementing a client with an embedded server.

func NewServer Uses

func NewServer(loader Loader) transport.Transport

NewServer returns a transport.Transport implementing a git server, independent of transport. Each transport must wrap this.

type Loader Uses

type Loader interface {
    // Load loads a storer.Storer given a transport.Endpoint.
    // Returns transport.ErrRepositoryNotFound if the repository does not
    // exist.
    Load(ep *transport.Endpoint) (storer.Storer, error)
}

Loader loads repository's storer.Storer based on an optional host and a path.

func NewFilesystemLoader Uses

func NewFilesystemLoader(base billy.Filesystem) Loader

NewFilesystemLoader creates a Loader that ignores host and resolves paths with a given base filesystem.

type MapLoader Uses

type MapLoader map[string]storer.Storer

MapLoader is a Loader that uses a lookup map of storer.Storer by transport.Endpoint.

func (MapLoader) Load Uses

func (l MapLoader) Load(ep *transport.Endpoint) (storer.Storer, error)

Load returns a storer.Storer for given a transport.Endpoint by looking it up in the map. Returns transport.ErrRepositoryNotFound if the endpoint does not exist.

Package server imports 16 packages (graph) and is imported by 5 packages. Updated 2019-08-01. Refresh now. Tools for package owners.