golang.org/x/playground@v0.0.0-20230418134305-14ebe15bcd59/sandbox/sandboxtypes/types.go (about)

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // The sandboxtypes package contains the shared types
     6  // to communicate between the different sandbox components.
     7  package sandboxtypes
     8  
     9  // Response is the response from the x/playground/sandbox backend to
    10  // the x/playground frontend.
    11  //
    12  // The stdout/stderr are base64 encoded which isn't ideal but is good
    13  // enough for now. Maybe we'll move to protobufs later.
    14  type Response struct {
    15  	// Error, if non-empty, means we failed to run the binary.
    16  	// It's meant to be user-visible.
    17  	Error string `json:"error,omitempty"`
    18  
    19  	ExitCode int    `json:"exitCode"`
    20  	Stdout   []byte `json:"stdout"`
    21  	Stderr   []byte `json:"stderr"`
    22  }