repo

package
v0.0.0-...-f0d8a09 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_AUTH_USER_ID           = "FG_AUTH_USER_ID"
	ENV_AUTH_USER_NAME         = "FG_AUTH_USER_NAME"
	ENV_AUTH_USER_EMAIL        = "FG_AUTH_USER_EMAIL"
	ENV_REPO_OWNER_NAME        = "FG_REPO_OWNER_NAME"
	ENV_REPO_OWNER_SALT_MD5    = "FG_REPO_OWNER_SALT_MD5"
	ENV_REPO_ID                = "FG_REPO_ID"
	ENV_REPO_NAME              = "FG_REPO_NAME"
	ENV_REPO_CUSTOM_HOOKS_PATH = "FG_REPO_CUSTOM_HOOKS_PATH"
)

Variables

This section is empty.

Functions

func ComposeHookEnvs

func ComposeHookEnvs(opts ComposeHookEnvsOptions) []string

func IsReadmeFile

func IsReadmeFile(name string) bool

func RepoCreate

func RepoCreate(UserOrOrg, ProjectName string) (bool, error)

Init Git Repo Project

func RepoCreateMirror

func RepoCreateMirror(RemoteAddr, UserOrOrg, ProjectName string) error

func RepoDelete

func RepoDelete(UserOrOrg, ProjectName string) (bool, error)

Delete Repo

func RepoEditorFile

func RepoEditorFile(UserOrOrg, ProjectName string, opts *pb.ReqUpdateOptions) error

func RepoList

func RepoList(UserOrOrg, ProjectName, TreePath string) (error, *pb.RespList)

func RepoUpdateMirror

func RepoUpdateMirror(RemoteAddr, UserOrOrg, ProjectName string) error

func UpdateLocalCopyBranch

func UpdateLocalCopyBranch(repoPath, localPath, branch string, isWiki bool) (err error)

UpdateLocalCopy fetches latest changes of given branch from repoPath to localPath. It creates a new clone if local copy does not exist, but does not checks out to a specific branch if the local copy belongs to a wiki. For existing local copy, it checks out to target branch by default, and safe to assume subsequent operations are against target branch when caller has confidence about no race condition.

Types

type ComposeHookEnvsOptions

type ComposeHookEnvsOptions struct {
	AuthUser  string
	OwnerName string
	OwnerSalt string
	RepoID    int64
	RepoName  string
	RepoPath  string
}

type Repo

type Repo struct {
	Commit     *git.Commit
	LastCommit *git.Commit

	Tag     *git.Tag
	GitRepo *git.Repository

	TipPath string
	Path    string
}

func (*Repo) GetFile

func (repo *Repo) GetFile(entry *git.TreeEntry) (*pb.RespSingle, error)

func (*Repo) GetFileList

func (repo *Repo) GetFileList(path string) ([]*git.EntryCommitInfo, error)

func (*Repo) GetReadme

func (repo *Repo) GetReadme(entry *git.TreeEntry) (*pb.RespSingle, error)

func (*Repo) Init

func (repo *Repo) Init(UserOrOrg, ProjectName string) error

func (*Repo) RequestPath

func (repo *Repo) RequestPath(path string) error

type Server

type Server struct {
}

func (*Server) Create

func (s *Server) Create(ctx context.Context, message *pb.ReqBase) (*pb.RespBool, error)

func (*Server) CreateMirror

func (s *Server) CreateMirror(ctx context.Context, opts *pb.ReqMirror) (*pb.RespBool, error)

func (*Server) Delete

func (s *Server) Delete(ctx context.Context, message *pb.ReqBase) (*pb.RespBool, error)

func (*Server) Editor

func (s *Server) Editor(ctx context.Context, opts *pb.ReqUpdateOptions) (*pb.RespBool, error)

func (*Server) List

func (s *Server) List(ctx context.Context, message *pb.ReqList) (*pb.RespList, error)

Jump to

Keyboard shortcuts

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