gitdb

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckoutHandler

type CheckoutHandler struct {
	Checkouts map[string]*GitCheckout
	Log       *log.Logger
}

func NewHandler added in v0.0.8

func NewHandler(logger *log.Logger, cfg Config) (*CheckoutHandler, error)

func (*CheckoutHandler) CheckoutsByRepo added in v0.0.8

func (h *CheckoutHandler) CheckoutsByRepo() map[string]*GitCheckout

func (*CheckoutHandler) SetupMux

func (h *CheckoutHandler) SetupMux(mux *mux.Router)

type Config added in v0.0.8

type Config struct {
	DataDirectory    string
	Repos            string
	PrivateKey       string
	PrivateKeyPasswd string
}

type FileStat added in v0.0.10

type FileStat struct {
	Name string
	Mode uint32
	Hash string
}

type FileStatArr added in v0.0.10

type FileStatArr []FileStat

func (FileStatArr) WriteTo added in v0.0.10

func (f FileStatArr) WriteTo(w io.Writer) (int64, error)

type GitCheckout

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

func (*GitCheckout) AbsPath

func (g *GitCheckout) AbsPath() string

func (*GitCheckout) FileContent

func (g *GitCheckout) FileContent(ctx context.Context, fileName string) (io.WriterTo, error)

Will eventually want to cache this

func (*GitCheckout) LsDir added in v0.0.10

func (g *GitCheckout) LsDir(ctx context.Context, dir string) (retStat []FileStat, retErr error)

func (*GitCheckout) LsFiles

func (g *GitCheckout) LsFiles(ctx context.Context) ([]string, error)

func (*GitCheckout) Refresh

func (g *GitCheckout) Refresh(ctx context.Context) error

func (*GitCheckout) RemoteExists

func (g *GitCheckout) RemoteExists(remote string) bool

func (*GitCheckout) WithReference

func (g *GitCheckout) WithReference(ctx context.Context, refName string) (*GitCheckout, error)

type GitOperator

type GitOperator struct {
	Log *log.Logger
}

func (*GitOperator) Clone

func (g *GitOperator) Clone(ctx context.Context, into string, remoteURL string, auth transport.AuthMethod) (*GitCheckout, error)

Directories

Path Synopsis
repoprovider

Jump to

Keyboard shortcuts

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