Documentation
¶
Index ¶
- Constants
- func EscapeNLs(input string) string
- type File
- type Fork
- type GistResponse
- func (g *GistResponse) GetFile(filename string) File
- func (g *GistResponse) GetFiles() []File
- func (g GistResponse) String() string
- func (g *GistResponse) UserAvatarUrl() string
- func (g *GistResponse) UserGravatarId() string
- func (g *GistResponse) UserId() int
- func (g *GistResponse) UserLogin() string
- func (g *GistResponse) UserUrl() string
- type History
- type User
Constants ¶
const GET_GIST = `` /* 1678-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fork ¶
A structure compatible with github's fork representation inside of a gist JSON structure
type GistResponse ¶
type GistResponse struct {
Url string
Id string
Description string
Public bool
UserMap map[string]User
Files map[string]File
Comments int
Html_Url string
Git_Pull_Url string
Git_Push_Url string
Created_At string
Forks []Fork
History []History
}
A GistResponse is designed to be a compatible representation with github's JSON representation of a Gist. Go's builtin encoding/json package makes use of this struct when unpacking data recieved from github.
func GetGistResponse ¶
func GetGistResponse(id int) GistResponse
Returns a gist response (unpacked from JSON reply) that is associated with id.
func ListUserGists ¶
func ListUserGists(user string) []GistResponse
Returns a list of gist responses (unpacked from JSON reply) that is associated with a user login.
func PushGist ¶
func PushGist(description string, files ...File) GistResponse
Push a file (or multiple files) to gist.github.com. This is just a convenience function that wraps PushMultiGist, which does the work.
func PushMultiGist ¶
func PushMultiGist(description string, files []File) GistResponse
Push a file (or multiple files) to gist.github.com. Currently only creating anonymous gists is supported. One possible workaround for now is to just fork the anonymous gist into your own account.
func (*GistResponse) GetFile ¶
func (g *GistResponse) GetFile(filename string) File
The specific file associated with filename that is provided in a JSON response from github.
func (*GistResponse) GetFiles ¶
func (g *GistResponse) GetFiles() []File
The list of files provided in a JSON response from github.
func (GistResponse) String ¶
func (g GistResponse) String() string
A String representation of a JSON response from github.
func (*GistResponse) UserAvatarUrl ¶
func (g *GistResponse) UserAvatarUrl() string
The user avatar url provided in a JSON response from github.
func (*GistResponse) UserGravatarId ¶
func (g *GistResponse) UserGravatarId() string
The user gravatar id provided in a JSON response from github.
func (*GistResponse) UserId ¶
func (g *GistResponse) UserId() int
The user id provided in a JSON response from github.
func (*GistResponse) UserLogin ¶
func (g *GistResponse) UserLogin() string
The user login provided in a JSON response from github.
func (*GistResponse) UserUrl ¶
func (g *GistResponse) UserUrl() string
The user url provided in a JSON response from github.