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

package common

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

Package common implements the git pack protocol with a pluggable transport. This is a low-level package to implement new transports. Use a concrete implementation instead (e.g. http, file, ssh).

A simple example of usage can be found in the file package.

Index

Package Files

common.go server.go

Variables

var (
    ErrTimeoutExceeded = errors.New("timeout exceeded")
)

func DecodeUploadPackResponse Uses

func DecodeUploadPackResponse(r io.ReadCloser, req *packp.UploadPackRequest) (
    *packp.UploadPackResponse, error,
)

DecodeUploadPackResponse decodes r into a new packp.UploadPackResponse

func NewClient Uses

func NewClient(runner Commander) transport.Transport

NewClient creates a new client using the given Commander.

func ServeReceivePack Uses

func ServeReceivePack(cmd ServerCommand, s transport.ReceivePackSession) error

func ServeUploadPack Uses

func ServeUploadPack(cmd ServerCommand, s transport.UploadPackSession) (err error)

type Command Uses

type Command interface {
    // StderrPipe returns a pipe that will be connected to the command's
    // standard error when the command starts. It should not be called after
    // Start.
    StderrPipe() (io.Reader, error)
    // StdinPipe returns a pipe that will be connected to the command's
    // standard input when the command starts. It should not be called after
    // Start. The pipe should be closed when no more input is expected.
    StdinPipe() (io.WriteCloser, error)
    // StdoutPipe returns a pipe that will be connected to the command's
    // standard output when the command starts. It should not be called after
    // Start.
    StdoutPipe() (io.Reader, error)
    // Start starts the specified command. It does not wait for it to
    // complete.
    Start() error
    // Close closes the command and releases any resources used by it. It
    // will block until the command exits.
    Close() error
}

Command is used for a single command execution. This interface is modeled after exec.Cmd and ssh.Session in the standard library.

type CommandKiller Uses

type CommandKiller interface {
    // Kill and close the session whatever the state it is. It will block until
    // the command is terminated.
    Kill() error
}

CommandKiller expands the Command interface, enableing it for being killed.

type Commander Uses

type Commander interface {
    // Command creates a new Command for the given git command and
    // endpoint. cmd can be git-upload-pack or git-receive-pack. An
    // error should be returned if the endpoint is not supported or the
    // command cannot be created (e.g. binary does not exist, connection
    // cannot be established).
    Command(cmd string, ep *transport.Endpoint, auth transport.AuthMethod) (Command, error)
}

Commander creates Command instances. This is the main entry point for transport implementations.

type ServerCommand Uses

type ServerCommand struct {
    Stderr io.Writer
    Stdout io.WriteCloser
    Stdin  io.Reader
}

ServerCommand is used for a single server command execution.

Package common imports 14 packages (graph) and is imported by 8 packages. Updated 2019-08-01. Refresh now. Tools for package owners.