githubwrap

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 8 Imported by: 0

README

Github-Wrapper

Simple Package that wrap Github api to make it easy to use.

currently feature :
  • Create file to repository
  • Get downloadable link from repository
  • Update file in repository
  • Delete file in repository
  • Get file content as byte from repository
  • Get file content from repository

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGithubClient

func NewGithubClient(httpClient *http.Client) (client *github.Client)

func NewOauth2Client

func NewOauth2Client(ctx context.Context, accessToken string) (client *http.Client)

func NewOauth2ClientLimited added in v0.0.5

func NewOauth2ClientLimited(ctx context.Context, accessToken string) (client *http.Client)

Types

type FilesService added in v0.0.5

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

func NewFilesService added in v0.0.5

func NewFilesService(client *github.Client, owner, repo string) (wrapper *FilesService)

func (*FilesService) ChangeRepository added in v0.0.5

func (wrp *FilesService) ChangeRepository(owner, repo string)

func (*FilesService) Create added in v0.0.5

func (wrp *FilesService) Create(ctx context.Context, path, message string, content []byte) (repopath string, err error)

func (*FilesService) Delete added in v0.0.5

func (wrp *FilesService) Delete(ctx context.Context, path, sha string) (file *github.RepositoryContentResponse, err error)

func (*FilesService) Download added in v0.0.5

func (wrp *FilesService) Download(ctx context.Context, path string) (file io.ReadCloser, err error)

func (*FilesService) GetContent added in v0.0.5

func (wrp *FilesService) GetContent(ctx context.Context, path string) (file *github.RepositoryContent, err error)
func (wrp *FilesService) GetLink(ctx context.Context, path string) (link string, err error)

func (*FilesService) GetPath added in v0.0.9

func (wrp *FilesService) GetPath(ctx context.Context, path string) (link string, err error)

func (*FilesService) Update added in v0.0.5

func (wrp *FilesService) Update(ctx context.Context, path, sha string, content []byte) (file *github.RepositoryContentResponse, err error)

Jump to

Keyboard shortcuts

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