go-git: github.com/go-git/go-git/plumbing/transport/server Index | Files

package server

import "github.com/go-git/go-git/plumbing/transport/server"

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


Package Files

loader.go server.go


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). Updated 2020-08-15. Refresh now. Tools for package owners.