shared

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFoundErr = errors.New("not found")

Functions

func GistIDFromURL added in v1.1.0

func GistIDFromURL(gistURL string) (string, error)

func IsBinaryContents added in v1.8.0

func IsBinaryContents(contents []byte) bool

func IsBinaryFile added in v1.8.0

func IsBinaryFile(file string) (bool, error)

Types

type Gist

type Gist struct {
	ID          string               `json:"id,omitempty"`
	Description string               `json:"description"`
	Files       map[string]*GistFile `json:"files"`
	UpdatedAt   time.Time            `json:"updated_at"`
	Public      bool                 `json:"public"`
	HTMLURL     string               `json:"html_url,omitempty"`
	Owner       *GistOwner           `json:"owner,omitempty"`
}

func GetGist

func GetGist(client *http.Client, hostname, gistID string) (*Gist, error)

func ListGists added in v1.7.0

func ListGists(client *http.Client, hostname string, limit int, visibility string) ([]Gist, error)

type GistFile

type GistFile struct {
	Filename string `json:"filename,omitempty"`
	Type     string `json:"type,omitempty"`
	Language string `json:"language,omitempty"`
	Content  string `json:"content"`
}

type GistOwner added in v1.1.0

type GistOwner struct {
	Login string `json:"login,omitempty"`
}

Jump to

Keyboard shortcuts

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