git2

package
v0.0.0-...-b6d8306 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REPO_SERVICE_ID = "3539"
	WEB_SERVICE_ID  = "145"
)
View Source
const (
	REPEAT_BACK_HEADER = "X-PleaseRepeatBack"
)

Variables

View Source
var (
	// additional (completed) repos the repobuilder service may read. For example, "skel-go"
	REPOBUILDER_READ = []uint64{64}
)
View Source
var (
	// these repos may be 'reset' back to 'bare' at any time
	RESETTABLE_REPOS = []uint64{216}
)

Functions

func GetDatabase

func GetDatabase() *sql.DB

func Start

func Start() error

Types

type CopyTrigger

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

func (*CopyTrigger) Copy

func (ct *CopyTrigger) Copy() error

func (*CopyTrigger) Debugf

func (ct *CopyTrigger) Debugf(format string, args ...interface{})

func (*CopyTrigger) Errorf

func (ct *CopyTrigger) Errorf(format string, args ...interface{})

type GIT2

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

func (*GIT2) CheckGitServer

func (g *GIT2) CheckGitServer(ctx context.Context, req *gitpb.CheckGitRequest) (*gitpb.CheckGitResponse, error)

func (*GIT2) CreateRepo

func (g *GIT2) CreateRepo(ctx context.Context, req *gitpb.CreateRepoRequest) (*gitpb.SourceRepository, error)

* this creates the database entries, but not the file structure (it does not involve calling the git binary * instead it makes a call via https to the domain&path specified with a special header. * this ensures we're creating the files on a gitserver that is triggered by the url * the call is authenticated via a temporary associationtoken

func (*GIT2) DeleteRepository

func (g *GIT2) DeleteRepository(ctx context.Context, req *gitpb.ByIDRequest) (*common.Void, error)

func (*GIT2) Fork

func (*GIT2) GetLatestBuild

func (g *GIT2) GetLatestBuild(ctx context.Context, req *gitpb.ByIDRequest) (*gitpb.Build, error)

func (*GIT2) GetRecentBuilds

func (g *GIT2) GetRecentBuilds(ctx context.Context, req *gitpb.ByIDRequest) (*gitpb.BuildList, error)

func (*GIT2) GetRepos

func (g *GIT2) GetRepos(ctx context.Context, req *common.Void) (*gitpb.SourceRepositoryList, error)

func (*GIT2) GetReposTags

func (g *GIT2) GetReposTags(ctx context.Context, req *gitpb.RepoTagRequest) (*gitpb.SourceRepositoryList, error)

func (*GIT2) GetReposWithFilter

func (g *GIT2) GetReposWithFilter(ctx context.Context, req *gitpb.RepoFilter) (*gitpb.SourceRepositoryList, error)

func (*GIT2) RepoBuilderComplete

func (g *GIT2) RepoBuilderComplete(ctx context.Context, req *gitpb.ByIDRequest) (*common.Void, error)

func (*GIT2) RepoByID

func (g *GIT2) RepoByID(ctx context.Context, req *gitpb.ByIDRequest) (*gitpb.SourceRepository, error)

func (*GIT2) RepoByURL

func (g *GIT2) RepoByURL(ctx context.Context, req *gitpb.ByURLRequest) (*gitpb.SourceRepository, error)

func (*GIT2) ResetRepository

func (g *GIT2) ResetRepository(ctx context.Context, req *gitpb.ByIDRequest) (*common.Void, error)

func (*GIT2) ServeHTTP

func (g *GIT2) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*GIT2) SetRepoFlags

func (g *GIT2) SetRepoFlags(ctx context.Context, req *gitpb.SetRepoFlagsRequest) (*common.Void, error)

func (*GIT2) UpdateRepoStatus

func (g *GIT2) UpdateRepoStatus(ctx context.Context, req *gitpb.UpdateRepoStatusRequest) (*gitpb.SourceRepository, error)

type GitURL

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

func NewGitURL

func NewGitURL(url string) *GitURL

func (*GitURL) RepoPath

func (g *GitURL) RepoPath() string
Examples:

/foobar.git/info/refs?foo=bar -> foobar /cnw/foobar.git/info/refs?foo=bar -> cnw/foobar /cnw/foobar/info/refs?foo=bar -> cnw/foobar

type HTTPRequest

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

func (*HTTPRequest) CreateRepo

func (h *HTTPRequest) CreateRepo()

func (*HTTPRequest) CreateRepoWithError

func (h *HTTPRequest) CreateRepoWithError(requireUser bool) (*gitpb.CreateRepoLog, error)

func (*HTTPRequest) Error

func (h *HTTPRequest) Error(err error)

func (*HTTPRequest) ErrorCode

func (h *HTTPRequest) ErrorCode(code int, msg string)

func (*HTTPRequest) GetCreateLog

func (h *HTTPRequest) GetCreateLog() (*gitpb.CreateRepoLog, error)

load the createlog from url/headers

func (*HTTPRequest) GetScriptDir

func (h *HTTPRequest) GetScriptDir() string

func (*HTTPRequest) GitRoot

func (h *HTTPRequest) GitRoot() string

func (*HTTPRequest) InvokeGitCGI

func (h *HTTPRequest) InvokeGitCGI(ctx context.Context)

func (*HTTPRequest) Printf

func (h *HTTPRequest) Printf(format string, args ...interface{})

func (*HTTPRequest) RecreateRepo

func (h *HTTPRequest) RecreateRepo()

func (*HTTPRequest) Respond

func (g *HTTPRequest) Respond(txt string)

if all goes well send this response and repeat the header "X-PleaseRepeatBack"

func (*HTTPRequest) ServeHTTP

func (h *HTTPRequest) ServeHTTP()

func (*HTTPRequest) SingleHeader

func (g *HTTPRequest) SingleHeader(name string) string

get a single header from the request

func (*HTTPRequest) Username

func (h *HTTPRequest) Username() string

func (*HTTPRequest) Write

func (g *HTTPRequest) Write(b []byte)

type Repo

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

func RepoFromURL

func RepoFromURL(ctx context.Context, host string, git_url *GitURL) (*Repo, error)

func (*Repo) AbsDirectory

func (r *Repo) AbsDirectory() string

the absolute path to the git directory

func (*Repo) ExistsOnDisk

func (r *Repo) ExistsOnDisk() bool

func (*Repo) OnDiskPath

func (g *Repo) OnDiskPath() string

Jump to

Keyboard shortcuts

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