repos

package
v0.0.0-...-98b09d8 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyRepo

func CopyRepo(path, remoteUrl string)

func CreateRepo

func CreateRepo(path string)

func GetDefaultBranch

func GetDefaultBranch(path string) string

Types

type BoltDb

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

func (BoltDb) Close

func (db BoltDb) Close()

func (BoltDb) Create

func (db BoltDb) Create(name, web, description, branch string, isPrivate bool)

func (BoltDb) Delete

func (db BoltDb) Delete(repo *Repo)

func (BoltDb) Get

func (db BoltDb) Get(name string) *Repo

func (BoltDb) GetAll

func (db BoltDb) GetAll() []*Repo

func (BoltDb) Save

func (db BoltDb) Save(repo *Repo)

type ByName

type ByName []*Repo

func (ByName) Len

func (s ByName) Len() int

func (ByName) Less

func (s ByName) Less(i, j int) bool

func (ByName) Swap

func (s ByName) Swap(i, j int)

type Db

type Db interface {
	GetAll() []*Repo
	Get(name string) *Repo
	Create(name, web, description, branch string, isPrivate bool)
	Save(*Repo)
	Delete(*Repo)
	Close()
}

func Open

func Open(path, gitDir string) Db

type File

type File struct {
	Name        string
	Path        string
	IsDir       bool
	IsSubmodule bool
}

type GitRepo

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

func OpenRepo

func OpenRepo(path string) (*GitRepo, error)

func (*GitRepo) Branches

func (g *GitRepo) Branches() (branches []string)

func (*GitRepo) Files

func (g *GitRepo) Files(branch, root string) (files []File, err error)

func (*GitRepo) ReadFile

func (g *GitRepo) ReadFile(branch, file string) (string, error)

type Repo

type Repo struct {
	Name        string
	Web         string
	Description string
	Path        string
	Branch      string
	LastUpdate  time.Time
	IsPrivate   bool
}

func (*Repo) Branches

func (r *Repo) Branches() (branches []string)

func (*Repo) CloneUrl

func (r *Repo) CloneUrl() string

func (*Repo) Contents

func (r *Repo) Contents(file string) (string, bool)

func (*Repo) DefaultBranch

func (r *Repo) DefaultBranch() string

func (*Repo) Files

func (r *Repo) Files(tree string) (files []File, ok bool)

func (*Repo) IsEmpty

func (r *Repo) IsEmpty() bool

func (*Repo) Readme

func (r *Repo) Readme() (name string, contents template.HTML)

Jump to

Keyboard shortcuts

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