model

package
v0.0.0-...-f9dd4c8 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2017 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArmoredPublicKey

func ArmoredPublicKey(u *User) *bytes.Buffer

func HighlightedBlobHTML

func HighlightedBlobHTML(b *Blob) template.HTML

TODO: possibly do this for known blobs in a separate thread when staring the server?

func InitDB

func InitDB() *bolt.DB

Types

type Blame

type Blame struct {
	Users []*User
	*Blob
}

type Blob

type Blob struct {
	Path string
	Type string
	Data [][]byte
}

func (*Blob) ByteArray

func (b *Blob) ByteArray() []byte

type Commit

type Commit struct {
	User *User
	*git.Commit
}

func MakeCommit

func MakeCommit(g *git.Commit) *Commit

func (Commit) Date

func (c Commit) Date() time.Time

func (Commit) Hash

func (c Commit) Hash() string

type Diff

type Diff struct {
	CommitA *Commit
	CommitB *Commit
	Stats   string
	Hunks   []*DiffHunk
	*git.Diff
}

func GetDiff

func GetDiff(repo *Repo, commitA *Commit, commitB *Commit) Diff

type DiffHunk

type DiffHunk struct {
	OldPath string
	NewPath string
	Lines   []git.DiffLine
	*git.DiffHunk
}

func (*DiffHunk) AsPatch

func (h *DiffHunk) AsPatch() *Blob

TODO: make it generate a quick patch that could be curled

type Ref

type Ref struct {
	*git.Reference
}

func (Ref) NiceName

func (r Ref) NiceName() string

type Repo

type Repo struct {
	Name        string
	Filepath    string
	Description string
	*git.Repository
}

func LoadRepository

func LoadRepository(name string, repoPath string) *Repo

func (*Repo) CommitLog

func (repo *Repo) CommitLog(ref *Ref) []*Commit

func (Repo) LookupCommit

func (r Repo) LookupCommit(hash string) (*Commit, error)

func (*Repo) LookupRef

func (r *Repo) LookupRef(ref string) (Ref, error)

func (*Repo) ReadBlob

func (repo *Repo) ReadBlob(commit *Commit, filepath string) (*Blob, error)

func (*Repo) ReadBlobBlame

func (repo *Repo) ReadBlobBlame(commit *Commit, filepath string) (*Blame, error)

func (*Repo) Refs

func (repo *Repo) Refs() []*Ref

type TreeEntry

type TreeEntry struct {
	DirPath string
	*git.TreeEntry
}

func GetSubTree

func GetSubTree(t *git.Tree, treePath string) ([]TreeEntry, error)

TODO: combine getTreeEntry and getSubTree into one function

func GetTreeEntries

func GetTreeEntries(t *git.Tree, treePath string) []TreeEntry

func GetTreeEntry

func GetTreeEntry(t *git.Tree, treePath string) TreeEntry

type User

type User struct {
	Name   string
	Email  string
	Entity *openpgp.Entity
}

func UserFromEmail

func UserFromEmail(email string) *User

Jump to

Keyboard shortcuts

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