Documentation ¶
Index ¶
- Variables
- type AuthConf
- type AuthType
- type Conf
- type GithubAuthConf
- type ProgressWriter
- type Repo
- func (repo Repo) AddRepository(r RepositoryConf) error
- func (repo Repo) DeleteFile(name string, filename string) error
- func (repo Repo) GetFile(name string, filename string) ([]byte, error)
- func (repo Repo) GetRepoConfByCB(cb func(r RepositoryConf) bool) (*RepositoryConf, error)
- func (repo Repo) GetRepoConfByName(name string) (*RepositoryConf, error)
- func (repo Repo) Inspection(gitRepo *git.Repository)
- func (repo Repo) LoadConf() (*Conf, error)
- func (repo Repo) OpenRepository(name string) (*git.Repository, *RepositoryConf, error)
- func (repo *Repo) Pull(name string) error
- func (repo *Repo) Push(name string) error
- func (repo Repo) RemoveRepository(name string) error
- func (repo Repo) RepositoryTree(name string, ext ...string) (*dtree.VueTree, error)
- func (repo Repo) ResetRepository(name string) error
- func (repo Repo) SaveFile(name string, filename string, original string, data []byte) error
- type RepositoryConf
- type ServiceProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRepositoryNameExisted = errors.New("repository with same name already existed")
ErrRepositoryNameExisted 同名的仓库已经存在
View Source
var ErrRepositoryNotExist = errors.New("repository is not exist")
ErrRepositoryNotExist 仓库不存在错误
Functions ¶
This section is empty.
Types ¶
type AuthConf ¶
type AuthConf struct { Username string `json:"username"` Email string `json:"email"` GithubAuthConf *GithubAuthConf `json:"github_auth_conf"` }
type Conf ¶
type Conf struct { Repositories []RepositoryConf `json:"repositories"` AuthConf *AuthConf `json:"auth_conf"` }
type GithubAuthConf ¶
type ProgressWriter ¶
type ProgressWriter struct{}
func NewProgressWriter ¶
func NewProgressWriter() *ProgressWriter
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo Git 仓库
func (Repo) AddRepository ¶
func (repo Repo) AddRepository(r RepositoryConf) error
AddRepository 新增仓库配置
func (Repo) DeleteFile ¶
DeleteFile 删除文档
func (Repo) GetRepoConfByCB ¶
func (repo Repo) GetRepoConfByCB(cb func(r RepositoryConf) bool) (*RepositoryConf, error)
GetRepoConfByCB 通过 cb 回调函数来获取仓库配置
func (Repo) GetRepoConfByName ¶
func (repo Repo) GetRepoConfByName(name string) (*RepositoryConf, error)
GetRepoConfByName 通过仓库名获取仓库配置
func (Repo) OpenRepository ¶
func (repo Repo) OpenRepository(name string) (*git.Repository, *RepositoryConf, error)
OpenRepository 根据名称打开一个仓库
func (Repo) RemoveRepository ¶
RemoveRepository 删除仓库配置
func (Repo) RepositoryTree ¶
RepositoryTree 获取仓库目录树
func (Repo) ResetRepository ¶
ResetRepository 重置仓库
type RepositoryConf ¶
type RepositoryConf struct { Name string `json:"name"` Branch string `json:"branch"` URL string `json:"url"` StorageDir string `json:"storage_dir"` Type AuthType `json:"type"` AuthConf *AuthConf `json:"auth_conf"` Readonly bool `json:"readonly"` }
func (*RepositoryConf) Init ¶
func (rc *RepositoryConf) Init(repoConf *Conf)
type ServiceProvider ¶
type ServiceProvider struct{}
func (ServiceProvider) Boot ¶
func (s ServiceProvider) Boot(app glacier.Glacier)
func (ServiceProvider) Register ¶
func (s ServiceProvider) Register(app container.Container)
Click to show internal directories.
Click to hide internal directories.