Version: v0.0.0-...-8817f42 Latest Latest

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

Go to latest
Published: May 4, 2020 License: GPL-3.0 Imports: 31 Imported by: 0




This section is empty.


This section is empty.


func DumpTree

func DumpTree(b []byte) ([]*object.TreeEntry, error)

func EncodedObj

func EncodedObj(o plumbing.EncodedObject) (blob []byte, err error)

func EncodedObject

func EncodedObject(o plumbing.EncodedObject) (h plumbing.Hash, blob []byte, err error)

func Entry2Map

func Entry2Map(entries []*object.TreeEntry, m map[plumbing.Hash]*Inode) map[plumbing.Hash]*Inode

func GetUrlPath

func GetUrlPath(name, ReposDir string, githubServer []string) (url, path, filename string, err error)

func ObjToCommit

func ObjToCommit(v []byte) (*object.Commit, error)

func PlainClone

func PlainClone(url string) (*git.Repository, error)

func PlainCloneFS

func PlainCloneFS(url, path string) (*git.Repository, error)

func PlainOpen

func PlainOpen(path string) (*git.Repository, error)

func SetEncodedObject

func SetEncodedObject(dir *dotgit.DotGit, o plumbing.EncodedObject) (h plumbing.Hash, err error)

func Tree

func Tree(root plumbing.Hash, g DBGeter) (map[plumbing.Hash]*Inode, error)

func TreeEntry2String

func TreeEntry2String(e *object.TreeEntry) string

func TreeFlat

func TreeFlat(r *git.Repository) ([]string, error)

func Trees

func Trees(r *git.Repository, tcb func(k, v []byte) error, rdb RefDBer) error

func Upload

func Upload(url string, pack io.Writer) (refs memory.ReferenceStorage, err error)


type Client

type Client struct {
	C   *github.Client
	Ctx context.Context

func NewGitHubClient

func NewGitHubClient() *Client

func NewGitHubClientWithoutToken

func NewGitHubClientWithoutToken() *Client

func (*Client) GetRef

func (c *Client) GetRef(owner, repo string) ([]Ref, error)

func (*Client) ListAll

func (c *Client) ListAll(start int64) (int64, []Repository, error)

type DBGeter

type DBGeter interface {
	GetRawTree(k []byte, cb func(v []byte) error) error

type Inode

type Inode struct {
	Mode filemode.FileMode
	Name string

func NewInode

func NewInode(e *object.TreeEntry) *Inode

type Record

type Record struct {
	Language string
	Star     uint64
	Refs     []Ref
	Last     uint64

func (*Record) String

func (r *Record) String() string

type Ref

type Ref struct {
	Name string
	Hash string

func Clone

func Clone(url, repos string) ([]Ref, error)

func CloneToFS

func CloneToFS(path, url string, cb func(*object.Blob) error) ([]Ref, error)

func CloneToMem

func CloneToMem(url string) ([]Ref, map[plumbing.Hash][]byte, error)

func EmptyRef

func EmptyRef() []Ref

func RepoRef

func RepoRef(r *git.Repository) []Ref

type RefDBer

type RefDBer interface {
	HasRawRef(h []byte) bool
	PutRawRef(h, b []byte) error

type RefRecord

type RefRecord struct {
	LocalOK  bool
	ServerOK bool
	Build    bool
	Refs     []Ref
	Last     time.Time

func EncodeRef

func EncodeRef(buf []byte) *RefRecord

func NewBuildRecord

func NewBuildRecord(refs []Ref) *RefRecord

func NewRefRecord

func NewRefRecord(refs []Ref) *RefRecord

func (*RefRecord) DecodeRef

func (r *RefRecord) DecodeRef() []byte

func (*RefRecord) IsBuild

func (r *RefRecord) IsBuild() bool

func (*RefRecord) LastSeen

func (r *RefRecord) LastSeen() time.Time

func (*RefRecord) OK

func (r *RefRecord) OK() bool

func (*RefRecord) RemoteOK

func (r *RefRecord) RemoteOK() bool

type Repository

type Repository struct {
	ID       int64
	FullName string

Jump to

Keyboard shortcuts

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