Documentation ¶
Index ¶
- Constants
- type Client
- func (client *Client) CompileRaw(raw []byte, vet bool) (CompileResult, error)
- func (client *Client) CompileSnippet(id string, vet bool) (CompileResult, error)
- func (client *Client) Fmt(id string, fixImport bool) ([]byte, error)
- func (client *Client) FmtRaw(raw []byte, fixImport bool) ([]byte, error)
- func (client *Client) HealCheck() (bool, error)
- func (client *Client) Share(raw []byte) (string, error)
- func (client *Client) Version() (Version, error)
- func (client *Client) View(id string) ([]byte, error)
- type CompileResult
- type Event
- type FmtResult
- type Option
- type Options
- type Version
Constants ¶
View Source
const ( FmtUrl = "/fmt" VersionUrl = "/version" CompileUrl = "/compile" HealthUrl = "/_ah/health" ViewUrl = "/p/%s.go" DefaultPlayground = "https://play.golang.org" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the go playground http client see https://github.com/golang/playground to learn more about playground server.
func (*Client) CompileRaw ¶
func (client *Client) CompileRaw(raw []byte, vet bool) (CompileResult, error)
CompileRaw compiles the give code snippet, and returns the result
func (*Client) CompileSnippet ¶
func (client *Client) CompileSnippet(id string, vet bool) (CompileResult, error)
CompileSnippet compiles the specified code snippet, and returns the result
type CompileResult ¶
type CompileResult struct { Errors string Events []Event Status int IsTest bool TestsFailed int // VetErrors, if non-empty, contains any vet errors. It is // only populated if request.WithVet was true. VetErrors string `json:",omitempty"` // VetOK reports whether vet ran & passed. It is only // populated if request.WithVet was true. Only one of // VetErrors or VetOK can be non-zero. VetOK bool `json:",omitempty"` }
Click to show internal directories.
Click to hide internal directories.