Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( MaxFilesSnippetSize int64 = 60 * 1024 MaxScriptSnippetSize int64 = 1 * 1024 * 1024 )
var DefaultCorsConfig = CorsConfig{ AllowOrigins: []string{"*"}, AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, AllowHeaders: []string{"Authorization", "Origin", "Content-Type", "Content-Length"}, ExposeHeaders: []string{"Content-Length", "Authorization", "Content-Type"}, AllowCredentials: true, MaxAge: 300, }
DefaultCorsConfig is the configuration that will be used in none is provided.
var JWTAuth *jwtauth.JWTAuth
Functions ¶
Types ¶
type CorsConfig ¶ added in v1.17.0
type Handler ¶
type Handler struct {
Config *Config
}
func (*Handler) ActionListHandler ¶ added in v1.1.3
func (h *Handler) ActionListHandler(w http.ResponseWriter, _ *http.Request)
func (*Handler) RunFilesHandler ¶
func (h *Handler) RunFilesHandler(w http.ResponseWriter, r *http.Request)
func (*Handler) RunScriptHandler ¶
func (h *Handler) RunScriptHandler(w http.ResponseWriter, r *http.Request)
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder records the standard and error outputs of a sandbox program (comprised of playback headers) and converts it to a sequence of Events. It sanitizes each Event's Message to ensure it is valid UTF-8.
Playground programs precede all their writes with a header (described below) that describes the time the write occurred (in playground time) and the length of the data that will be written. If a non-header is encountered where a header is expected, the output is scanned for the next header and the intervening text string is added to the sequence an event occurring at the same time as the preceding event.
A playback header has this structure:
4 bytes: "\x00\x00PB", a magic header 8 bytes: big-endian int64, unix time in nanoseconds 4 bytes: big-endian int32, length of the next write