shim

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OK constant - status code less than 400, endorser will endorse it.
	// OK means init or invoke successfully.
	OK = 200

	// ERROR constant - default error value
	ERROR = 500
)

Variables

This section is empty.

Functions

func ParseForm

func ParseForm(args []string) (form map[string][]string, err error)

Types

type Response

type Response struct {
	// A status code that should follow the HTTP status codes.
	Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`

	// A payload that can be used to include metadata with this response.
	Payload io.Reader `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
}

A response with a representation similar to an HTTP response that can be used within another message.

func (*Response) SetStatus

func (r *Response) SetStatus(code int)

func (*Response) Write

func (r *Response) Write(payload []byte) (n int, err error)

type ResponseWriter

type ResponseWriter interface {
	SetStatus(int)
	Write([]byte) (int, error)
}

Jump to

Keyboard shortcuts

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