github

package
v3.50.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	driver.RootPath
	Token            string `json:"token" type:"string" required:"true"`
	Owner            string `json:"owner" type:"string" required:"true"`
	Repo             string `json:"repo" type:"string" required:"true"`
	Ref              string `json:"ref" type:"string" help:"A branch, a tag or a commit SHA, main branch by default."`
	GitHubProxy      string `` /* 151-byte string literal not displayed */
	GPGPrivateKey    string `json:"gpg_private_key" type:"text"`
	GPGKeyPassphrase string `json:"gpg_key_passphrase" type:"string"`
	CommitterName    string `json:"committer_name" type:"string"`
	CommitterEmail   string `json:"committer_email" type:"string"`
	AuthorName       string `json:"author_name" type:"string"`
	AuthorEmail      string `json:"author_email" type:"string"`
	MkdirCommitMsg   string `json:"mkdir_commit_message" type:"text" default:"{{.UserName}} mkdir {{.ObjPath}}"`
	DeleteCommitMsg  string `json:"delete_commit_message" type:"text" default:"{{.UserName}} remove {{.ObjPath}}"`
	PutCommitMsg     string `json:"put_commit_message" type:"text" default:"{{.UserName}} upload {{.ObjPath}}"`
	RenameCommitMsg  string `json:"rename_commit_message" type:"text" default:"{{.UserName}} rename {{.ObjPath}} to {{.TargetName}}"`
	CopyCommitMsg    string `json:"copy_commit_message" type:"text" default:"{{.UserName}} copy {{.ObjPath}} to {{.TargetPath}}"`
	MoveCommitMsg    string `json:"move_commit_message" type:"text" default:"{{.UserName}} move {{.ObjPath}} to {{.TargetPath}}"`
}

type BranchResp

type BranchResp struct {
	Name   string     `json:"name"`
	Commit CommitResp `json:"commit"`
}

type CommitResp

type CommitResp struct {
	Sha string `json:"sha"`
}

type ErrResp

type ErrResp struct {
	Message          string `json:"message"`
	DocumentationURL string `json:"documentation_url"`
	Status           string `json:"status"`
}

type Github

type Github struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*Github) Config

func (d *Github) Config() driver.Config

func (*Github) Copy

func (d *Github) Copy(ctx context.Context, srcObj, dstDir model.Obj) error

func (*Github) Drop

func (d *Github) Drop(ctx context.Context) error

func (*Github) GetAddition

func (d *Github) GetAddition() driver.Additional

func (*Github) Init

func (d *Github) Init(ctx context.Context) error
func (d *Github) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*Github) List

func (d *Github) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*Github) MakeDir

func (d *Github) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error

func (*Github) Move

func (d *Github) Move(ctx context.Context, srcObj, dstDir model.Obj) error

func (*Github) Put

func (d *Github) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error

func (*Github) Remove

func (d *Github) Remove(ctx context.Context, obj model.Obj) error

func (*Github) Rename

func (d *Github) Rename(ctx context.Context, srcObj model.Obj, newName string) error
type Links struct {
	Git  string `json:"git"`
	Html string `json:"html"`
	Self string `json:"self"`
}

type MessageTemplateVars

type MessageTemplateVars struct {
	UserName   string
	ObjName    string
	ObjPath    string
	ParentName string
	ParentPath string
	TargetName string
	TargetPath string
}

type Object

type Object struct {
	Type            string   `json:"type"`
	Encoding        string   `json:"encoding" required:"false"`
	Size            int64    `json:"size"`
	Name            string   `json:"name"`
	Path            string   `json:"path"`
	Content         string   `json:"Content" required:"false"`
	Sha             string   `json:"sha"`
	URL             string   `json:"url"`
	GitURL          string   `json:"git_url"`
	HtmlURL         string   `json:"html_url"`
	DownloadURL     string   `json:"download_url"`
	Entries         []Object `json:"entries" required:"false"`
	Links           Links    `json:"_links"`
	SubmoduleGitURL string   `json:"submodule_git_url" required:"false"`
	Target          string   `json:"target" required:"false"`
}

type PutBlobResp

type PutBlobResp struct {
	URL string `json:"url"`
	Sha string `json:"sha"`
}

type RepoResp

type RepoResp struct {
	DefaultBranch string `json:"default_branch"`
}

type TreeObjReq

type TreeObjReq struct {
	Path string      `json:"path"`
	Mode string      `json:"mode"`
	Type string      `json:"type"`
	Sha  interface{} `json:"sha"`
}

type TreeObjResp

type TreeObjResp struct {
	TreeObjReq
	Size int64  `json:"size" required:"false"`
	URL  string `json:"url"`
}

type TreeReq

type TreeReq struct {
	BaseTree interface{}   `json:"base_tree,omitempty"`
	Trees    []interface{} `json:"tree"`
}

type TreeResp

type TreeResp struct {
	Sha       string        `json:"sha"`
	URL       string        `json:"url"`
	Trees     []TreeObjResp `json:"tree"`
	Truncated bool          `json:"truncated"`
}

type UpdateRefReq

type UpdateRefReq struct {
	Sha   string `json:"sha"`
	Force bool   `json:"force"`
}

type UserResp added in v3.43.0

type UserResp struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

Jump to

Keyboard shortcuts

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