github

package
v0.0.0-...-e633eee Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RetUrlCodePath  = 0
	RetUrlCodeQuery = 1
)

Variables

This section is empty.

Functions

func AccessTokenFromContext

func AccessTokenFromContext(ctx context.Context) string

func AuthCodeURL

func AuthCodeURL(state string) string

func CommitBlob

func CommitBlob(ctx context.Context, accessToken string, owner string, repo string, ref string, path string, content *string, commitMessage string) (*github.Response, error)

func CommitBlobs

func CommitBlobs(ctx context.Context, accessToken string, owner string, repo string, ref string, items []BlobEntry, commitMessage string) (*github.Response, error)

func CreateBlob

func CreateBlob(ctx context.Context, accessToken string, owner string, repo string, ref string, content *string, encoding *string) (*github.Blob, *github.Response, error)

func DecodeState

func DecodeState(r *http.Request) (string, string)

func DecryptExchangeCode

func DecryptExchangeCode(code string) (string, error)

func DeleteFiles

func DeleteFiles(ctx context.Context, accessToken string, owner string, repo string, ref string, path string, commitMessage string, fileNames []string) (*github.Response, error)

func DeleteFolder

func DeleteFolder(ctx context.Context, accessToken string, owner string, repo string, ref string, path string, commitMessage string) (*github.Response, error)

func DeleteFolders

func DeleteFolders(ctx context.Context, accessToken string, owner string, repo string, ref string, paths []string, commitMessage string) (*github.Response, error)

func EncodeState

func EncodeState(r *http.Request, oauthStateSecret string) (string, error)

func EncryptAccessToken

func EncryptAccessToken(accessToken string) (string, error)

func Exchange

func Exchange(code string) (string, error)

func GetAllLocaleContents

func GetAllLocaleContents(ctx context.Context, accessToken string, owner string, repo string, ref string, path string) ([]*github.RepositoryContent, *github.Response, error)

func GetAllLocaleContentsWithTree

func GetAllLocaleContentsWithTree(ctx context.Context, accessToken string, owner string, repo string, ref string, path string, prefix string) ([]*github.RepositoryContent, *github.Response, error)

func GetArchivedContents

func GetArchivedContents(ctx context.Context, accessToken string, owner string, repo string, ref string, path string) ([]*github.RepositoryContent, *github.Response, error)

func GetBlob

func GetBlob(ctx context.Context, accessToken string, owner string, repo string, ref, path string) ([]byte, *github.Response, error)

func GetCommits

func GetCommits(ctx context.Context, accessToken string, owner string, repo string, ref string) ([]*github.RepositoryCommit, *github.Response, error)

func GetContentsRecursive

func GetContentsRecursive(ctx context.Context, accessToken string, owner string, repo string, ref string, path string) ([]*github.RepositoryContent, *github.Response, error)

func GetContentsRecursive_old

func GetContentsRecursive_old(ctx context.Context, accessToken string, owner string, repo string, ref string, path string) ([]*github.RepositoryContent, *github.Response, error)

func GetDirectorySha

func GetDirectorySha(ctx context.Context, accessToken string, owner string, repo string, ref string, path string) string

func GetFileContent

func GetFileContent(ctx context.Context, accessToken string, owner string, repo string, ref, path string) (*github.RepositoryContent, *github.Response, error)

func GetFilesContent

func GetFilesContent(ctx context.Context, accessToken string, owner string, repo string, ref string, path string, files []string) ([]*github.RepositoryContent, *github.Response, error)

func GetSchema

func GetSchema(ctx context.Context, accessToken string, owner string, repo string, ref string, path string) (*github.RepositoryContent, *github.Response, error)

func GetSchemasRecursive

func GetSchemasRecursive(ctx context.Context, accessToken string, owner string, repo string, ref string, path string) ([]*github.RepositoryContent, *github.Response, error)

func GetTree

func GetTree(ctx context.Context, accessToken string, owner string, repo string, branch string, path string) ([]*github.RepositoryContent, *github.Response, error)

func GetUser

func GetUser(ctx context.Context, accessToken string) (*github.User, error)

func ListBranches

func ListBranches(ctx context.Context, accessToken string, owner, repo string) ([]*github.Branch, *github.Response, error)

func ListRepositories

func ListRepositories(ctx context.Context, accessToken string, page, perPage int, sort, direction string) ([]*github.Repository, *github.Response, error)

func ReturnURLWithCode

func ReturnURLWithCode(returnURL, code string, m int) (string, error)

func SearchContentsByID

func SearchContentsByID(ctx context.Context, accessToken string, owner string, repo string, ref string, path string, id string) ([]*github.RepositoryContent, *github.Response, error)

func UserFromContext

func UserFromContext(ctx context.Context) string

func WithUser

func WithUser(next http.Handler) http.Handler

Types

type BlobEntry

type BlobEntry struct {
	Path    string
	Content *string
	SHA     *string
}

func GetDeleteFileEntries

func GetDeleteFileEntries(ctx context.Context, accessToken string, owner string, repo string, ref string, path string, commitMessage string) ([]BlobEntry, error)

type Commit

type Commit struct {
	ID        string    `json:"id"`
	Added     []string  `json:"added"`
	Removed   []string  `json:"removed"`
	Modified  []string  `json:"modified"`
	Timestamp time.Time `json:"timestamp"`
}

type Owner

type Owner struct {
	Name string `json:"name"`
}

type PushHookPayload

type PushHookPayload struct {
	Ref        string     `json:"ref"`
	Repository Repository `json:"repository"`
	Commit     Commit     `json:"head_commit"`
	Pusher     Pusher     `json:"pusher"`
}

type Pusher

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

type Repository

type Repository struct {
	Name         string `json:"name"`
	FullName     string `json:"full_name"`
	URL          string `json:"url"`
	Owner        Owner  `json:"owner"`
	MasterBranch string `json:"master_branch"`
}

type User

type User struct {
	Login *string `json:"login"`
	Email *string `json:"email"`
	Image *string `json:"image"`
	Token string  `json:"token"`
}

Jump to

Keyboard shortcuts

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