gist

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnauthorizedError         = errors.New("Unauthorized")
	EmptyGistError            = errors.New("Cannot post empty gist")
	EmptyDescriptionGistError = errors.New("Cannot get gist with empty description")
	EmptyIdGistError          = errors.New("Cannot get gist with empty id")
)

Functions

func AreGistsFilesEquals

func AreGistsFilesEquals(gist1 *github.Gist, gist2 *github.Gist) bool

func CreateGistFromLocalFiles

func CreateGistFromLocalFiles(description string, files ...string) (gist *github.Gist, err error)

func CreateGistFromLocalFolder

func CreateGistFromLocalFolder(description string, localFolder string) (gist *github.Gist, err error)

func DeleteGist

func DeleteGist(ctx context.Context, gistId string) error

func GetClientFromContext

func GetClientFromContext(ctx context.Context) (*github.Client, error)

func GetGistByDescription

func GetGistByDescription(ctx context.Context, gistDescription string) (*github.Gist, error)

func GetGistById

func GetGistById(ctx context.Context, gistId string) (*github.Gist, error)

func HttpResponseError added in v0.10.2

func HttpResponseError(statusCode int, status string) error

func Log

func Log(format string, v ...interface{})

func NewGitContext

func NewGitContext(token string, ctx context.Context) (context.Context, error)

func PostGist

func PostGist(ctx context.Context, gist *github.Gist) (*github.Gist, error)

func SaveGistFilesToLocal

func SaveGistFilesToLocal(gist *github.Gist, localFolder string) (err error)

func SetDefaultLogger

func SetDefaultLogger()

func SetLogger

func SetLogger(logger *log.Logger)

Types

type SyncAction

type SyncAction byte
const (
	Upload SyncAction = iota
	Download
	NoAction
)

func SyncGistFiles

func SyncGistFiles(ctx context.Context, gist *github.Gist, localFolder string) (remoteGist *github.Gist, action SyncAction, err error)

Jump to

Keyboard shortcuts

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