smgithub

package
v0.0.0-...-a1afa3a Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CLIENT_ID = "Iv23liEjj0fbjwLQLDY0"

Variables

View Source
var Client *github.Client
View Source
var SCOPES = []string{"gist"}

Functions

func CreateGist

func CreateGist(ctx context.Context, description string, contents map[string]string, public bool) (*github.Gist, error)

func EditGist

func EditGist(ctx context.Context, gistID string, contents map[string]string, description string, public bool) (*github.Gist, error)

func GetUsername

func GetUsername(ctx context.Context) (string, error)

func IsLoggedIn

func IsLoggedIn(ctx context.Context) bool

func ListGists

func ListGists(ctx context.Context) ([]*github.Gist, error)

func Login

func Login(ctx context.Context, token string, httpClient *http.Client)

func ReadGist

func ReadGist(ctx context.Context, gistID *string) (*github.Gist, error)

func RemoveGist

func RemoveGist(ctx context.Context, gistID string) error

func UnauthenticatedLogin

func UnauthenticatedLogin(httpClient *http.Client)

Types

type UserInfo

type UserInfo struct {
	AuthKey  string
	Username string
}

func AuthFlow

func AuthFlow(isInteractive bool) UserInfo

Shamelessly copied from GitHub's cli

Jump to

Keyboard shortcuts

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