repo

package
v0.0.0-...-2581cb9 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Access

func Access(repo string, verb string, users []string) (bool, error)

func AccessWithLogin

func AccessWithLogin(org, repo, verb, username, password string) (bool, error)

func Add

func Add(repoId, branch string, files []AddFile, commitMessage string) error

func AddSubtrees

func AddSubtrees(repoId, branch string, subtrees []AddSubtree) error

TODO add subtree to an empty branch

func Blob

func Blob(repoId, ref, path string) (io.ReadCloser, error)

func Create

func Create(repoId string, req *CreateRequest) error

func Delete

func Delete(repoId string) error

func Exist

func Exist(repoId string) bool

func GitServer

func GitServer(command string, stdin io.Reader, stdout io.Writer, stderr io.Writer, users []string) (*exec.Cmd, error)

func Log

func Log(repoId, ref string) ([]byte, error)

func Pack

func Pack(repoId string, service string, out io.Writer, in io.Reader) error

func RefsInfo

func RefsInfo(repoId string, service string, out io.Writer) error

func TemplateId

func TemplateId(repo string) (string, error)

Types

type AddFile

type AddFile struct {
	Path    string
	Content io.Reader
	Mode    os.FileMode
}

type AddSubtree

type AddSubtree struct {
	Prefix      string // add subtree under specified directory
	Remote      string
	Ref         string
	SplitPrefix string `json:"splitPrefix"` // what directory from remote to extract, whole repo if empty
	Branch      string // if subtree split is requested then this is a branch to push the split branch to

	Squash bool
	// contains filtered or unexported fields
}

type CreateRequest

type CreateRequest struct {
	Remote  string
	Ref     string
	Squash  bool
	Message string
	Archive string
}

type RemoteWithRef

type RemoteWithRef struct {
	Remote string
	Ref    string
}

type RepoStatus

type RepoStatus struct {
	Commit  string `json:"commit,omitempty"`
	Ref     string `json:"ref,omitempty"`
	Date    string `json:"date,omitempty"`
	Author  string `json:"author,omitempty"`
	Subject string `json:"subject,omitempty"`
}

func Status

func Status(repoId, ref string) (*RepoStatus, error)

type UserAccess

type UserAccess struct {
	UserId   string
	CanWrite bool
}

Jump to

Keyboard shortcuts

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