wandgo

package module
v0.0.0-...-0ac4152 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2014 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Build Status Coverage Status GoDoc

WandGo

Wandbox API wrapper written by Golang.

Docs

GoDoc

https://godoc.org/github.com/pocke/wandgo

Wandbox API Reference

https://github.com/melpon/wandbox/blob/master/kennel2/API.rst

TODOs

https://github.com/pocke/wandgo/issues

LICENSE

Copyright © 2014 pocke Licensed [MIT][mit] [MIT]: http://www.opensource.org/licenses/mit-license.php

Documentation

Index

Constants

View Source
const (
	BaseURL = "http://melpon.org/wandbox/api"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	HTTPClient *http.Client
}

func NewAPI

func NewAPI() *API

NewAPI returns a API struct

func (*API) Compile

func (a *API) Compile(p *CompileParam) (*CompileResult, error)

func (*API) GetLanguages

func (a *API) GetLanguages() ([]Language, error)
func (a *API) GetPermlink(link string) (*Permlink, error)

type APIError

type APIError struct {
	Body string
}

func (*APIError) Error

func (a *APIError) Error() string

type CompileParam

type CompileParam struct {
	Compiler          string `json:"compiler"`
	Code              string `json:"code"`
	Options           string `json:"options"`
	Stdin             string `json:"stdin"`
	CompilerOptionRaw string `json:"compiler-option-raw"`
	RuntimeOptionRaw  string `json:"runtime-option-raw"`
	// contains filtered or unexported fields
}

type CompileResult

type CompileResult struct {
	Status          string `json:"status"`
	Signal          string `json:"signal"`
	CompilerOutput  string `json:"compiler_output"`
	CompilerError   string `json:"compiler_error"`
	CompilerMessage string `json:"compiler_message"`
	ProgramOutput   string `json:"program_output"`
	ProgramError    string `json:"program_error"`
	ProgramMessage  string `json:"program_message"`
	Permlink        string `json:"permlink"`
	URL             string `json:"url"`
}

type Language

type Language struct {
	CompilerOptionRaw     bool      `json:"compiler-option-raw"`
	DisplayCompileCommand string    `json:"display-compile-command"`
	Language              string    `json:"language"`
	Name                  string    `json:"name"`
	RuntimeOptionRaw      bool      `json:"runtime-option-raw"`
	Version               string    `json"version"`
	Switches              *Switches `json:"switches"`
}

type Option

type Option struct {
	DisplayFlags string `json:"display-flags"`
	DisplayName  string `json:"display-name"`
	Name         string `json:"name"`
}
type Permlink struct {
	Parameter *PermlinkParam `json:"parameter"`
	Result    *CompileResult `json:"result"`
}

type PermlinkParam

type PermlinkParam struct {
	CompileParam
	CreatedAt *iso8601.Time `json:"created-at"`
}

type SelectSwitch

type SelectSwitch struct {
	Default string   `json:"default"`
	Type    string   `json:"type"` // select
	Options []Option `json:"options"`
}

type SingleSwitch

type SingleSwitch struct {
	Default bool   `json:"default"`
	Type    string `json:"type"` // single
	Option
}

type Switches

type Switches struct {
	Single []SingleSwitch
	Select []SelectSwitch
}

func (*Switches) UnmarshalJSON

func (s *Switches) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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