git

package
v0.0.0-...-b26b2cd Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USERAPI_PREFIX  = "/api/v3/users/"
	USERAPI_POSTFIX = "/?private_token="
)
View Source
const (
	DEFAULT_BRANCH = "master"
)

Variables

View Source
var (
	Repositories = make(map[string]*Repository, 0)
)

Functions

func GitOrig2Http

func GitOrig2Http(url string) string

func GitOrig2Url

func GitOrig2Url(url string) string

func GitUrl2Orig

func GitUrl2Orig(url string) string

func Init

func Init(cfg config.GitConfig, repos map[string]*config.GitRepository) error

func InitGitLabApi

func InitGitLabApi(conf config.GitLab)

Types

type GitAuthor

type GitAuthor struct {
	User    string
	Email   string
	Date    time.Time
	DateStr string
}

type GitBlobLog

type GitBlobLog struct {
	Type  git2go.ObjectType
	Id    *git2go.Oid
	IdStr string
	Size  int64
}

type GitCommit

type GitCommit []GitCommitLog

func (GitCommit) Len

func (p GitCommit) Len() int

Forward request for length

func (GitCommit) Less

func (p GitCommit) Less(i, j int) bool

Define compare

func (GitCommit) Swap

func (p GitCommit) Swap(i, j int)

Define swap over an array

type GitCommitLog

type GitCommitLog struct {
	Type        git2go.ObjectType
	Id          *git2go.Oid
	IdStr       string
	Author      GitAuthor
	Commiter    GitAuthor
	ParentCount uint
	TreeId      *git2go.Oid
	Message     string
}

type GitEvents

type GitEvents struct {
	Push   bool
	Merge  bool
	Notify bool
}

type GitTreeLog

type GitTreeLog struct {
	Type       git2go.ObjectType
	Id         *git2go.Oid
	IdStr      string
	EntryCount uint64
}

type Repository

type Repository struct {
	Link          *git2go.Repository
	Callback      *git2go.RemoteCallbacks
	Path          string
	Branch        string
	Update        chan string
	Quit          chan bool
	QuitReport    chan bool
	Name          string
	Url           string
	Lock          bool
	FileWatchQuit chan bool

	FileUpdate     bool
	Error          bool
	LastError      string
	History        []UpdateHistory
	BlobLog        []GitBlobLog
	TreeLog        []GitTreeLog
	CommitLog      GitCommit
	Events         GitEvents
	SubDirectories []string
	// contains filtered or unexported fields
}

func (*Repository) GetUpdates

func (rep *Repository) GetUpdates() error

func (*Repository) InitFSWatch

func (rep *Repository) InitFSWatch()

func (*Repository) StartFSWatch

func (rep *Repository) StartFSWatch()

func (*Repository) StopFSWatch

func (rep *Repository) StopFSWatch()

type SSHConfig

type SSHConfig struct {
	PublicKey  []byte
	PrivateKey []byte
}

type UpdateHistory

type UpdateHistory struct {
	Author string
	Url    string
}

type UserInfo

type UserInfo struct {
	Name             string `json:"name"`
	Username         string `json:"username"`
	Id               int    `json:"id"`
	State            string `json:"state"`
	Avatar_url       string `json:"avatar_url"`
	Is_admin         bool   `json:"is_admin"`
	Skype            string `json:"skype"`
	LinkedIn         string `json:"linkedin"`
	Twitter          string `json:"twitter"`
	Website          string `json:"website_url"`
	Email            string `json:"email"`
	ThremeId         int    `json:"threme_id"`
	ColourSchemeId   int    `json:"color_scheme_id"`
	ProjectsLimit    int    `json:"projects_limit"`
	CanCreateGroup   bool   `json:"can_create_group"`
	CanCreateProject bool   `json:"can_create_project"`
}

func GetUserInfo

func GetUserInfo(userId int) (*UserInfo, error)

Jump to

Keyboard shortcuts

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