play

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(addr string, opts *Options) error

Types

type Event

type Event struct {
	Message string
	Kind    string        // "stdout" or "stderr"
	Delay   time.Duration // time to wait before printing Message
}

type Options

type Options struct {
	PlayMode          bool
	AllowShare        bool
	AllowOriginHeader string
	DisableCache      bool
	CompileURL        string
	DatabaseFile      string
}

type Request

type Request struct {
	Body string
}

type Response

type Response struct {
	Errors string
	Events []Event
}

type Snippet

type Snippet struct {
	Body []byte
}

func (*Snippet) Id

func (s *Snippet) Id(salt []byte) string

type WebServer

type WebServer struct {
	// contains filtered or unexported fields
}

func NewWebServer

func NewWebServer(opts *Options) *WebServer

func (*WebServer) EditHandler

func (p *WebServer) EditHandler(w http.ResponseWriter, r *http.Request)

func (*WebServer) Run

func (p *WebServer) Run(addr string) error

Jump to

Keyboard shortcuts

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