git

package
v0.0.0-...-5975cd0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPRedirect

func HTTPRedirect(url string, req *http.Request) *http.Response

HTTPRedirect create a temporary redirect http.Response with giving url

func NewStdoutReader

func NewStdoutReader(stdout io.Reader, cmd *exec.Cmd) io.Reader

NewStdoutReader return an io.reader that closes the command when it finishes reading data

Types

type LogBuffer

type LogBuffer struct {
	// contains filtered or unexported fields
}

LogBuffer implement interface of io.Writer

func NewLogBuffer

func NewLogBuffer(prefix string) *LogBuffer

NewLogBuffer create a LogBuffer instance

func (*LogBuffer) String

func (l *LogBuffer) String() string

String return cached logs

func (*LogBuffer) Write

func (l *LogBuffer) Write(p []byte) (n int, err error)

Write write log to stdout and collect logs to buffer

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implement interface of betproxy.Client

func NewServer

func NewServer(gopath, certpath string) *Server

NewServer create a Server instance The gopath should be a valid folder and will store git repositories later

func (*Server) Do

func (g *Server) Do(req *http.Request) (*http.Response, error)

Do receive client requests and return git repository information

type StdoutCloser

type StdoutCloser struct {
	// contains filtered or unexported fields
}

StdoutCloser implement interface of io.Reader

func (*StdoutCloser) Read

func (c *StdoutCloser) Read(p []byte) (n int, err error)

Read wait and close the child process to avoid zombie process

Jump to

Keyboard shortcuts

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