goplay

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSnippetTooLarge = fmt.Errorf("code snippet too large (max %d bytes)", maxSnippetSize)

Functions

This section is empty.

Types

type CompileEvent

type CompileEvent struct {
	Message string
	Kind    string
	Delay   time.Duration
}

CompileEvent represents individual event record in CompileResponse

type CompileResponse

type CompileResponse struct {
	Body   *string
	Events []*CompileEvent
	Errors string
}

CompileResponse is the response returned from upstream play.golang.org/compile request

func Compile

func Compile(ctx context.Context, src []byte) (*CompileResponse, error)

func (CompileResponse) GetBody

func (r CompileResponse) GetBody() string

func (*CompileResponse) HasError

func (cr *CompileResponse) HasError() error

type FmtResponse

type FmtResponse struct {
	Body  string
	Error string
}

FmtResponse is the response returned from upstream play.golang.org/fmt request

func GoImports

func GoImports(ctx context.Context, src []byte) (*FmtResponse, error)

func (*FmtResponse) HasError

func (r *FmtResponse) HasError() error

Jump to

Keyboard shortcuts

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