response

package
v0.0.0-...-75eda33 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chaincode

type Chaincode struct {
	Version string `json:"version,omitempty"`
}

type Client

type Client struct {
	MSPID   string `json:"mspid,omitempty"`
	Subject string `json:"subject,omitempty"`
	Issuer  string `json:"issuer,omitempty"`
}

type Payload

type Payload struct {
	Client          *Client      `json:"client,omitempty"`
	Chaincode       *Chaincode   `json:"chaincode,omitempty"`
	Transaction     *Transaction `json:"transaction,omitempty"`
	Content         interface{}  `json:"content,omitempty"`
	ContentEncoding string       `json:"content-encoding,omitempty"`
	Fault           interface{}  `json:"fault,omitempty"`
}

type Response

type Response struct {
	Status  int32
	Message string
	Payload *Payload
}

func BadRequest

func BadRequest(msg string, args ...interface{}) *Response

func BadRequestWithFault

func BadRequestWithFault(fault interface{}) *Response

func Direct

func Direct(res peer.Response) *Response

func Error

func Error(msg string, args ...interface{}) *Response

func Forbidden

func Forbidden(msg string, args ...interface{}) *Response

func NotFound

func NotFound() *Response

func NotFoundWithMessage

func NotFoundWithMessage(msg string, args ...interface{}) *Response

func NotImplemented

func NotImplemented(function string) *Response

func OK

func OK(result interface{}) *Response

func Status

func Status(status int32) *Response

func StatusWithFault

func StatusWithFault(status int32, fault interface{}) *Response

func StatusWithMessage

func StatusWithMessage(status int32, msg string, args ...interface{}) *Response

func StatusWithResult

func StatusWithResult(status int32, result interface{}) *Response

func (*Response) OK

func (r *Response) OK() bool

type Transaction

type Transaction struct {
	ID       string `json:"id,omitempty"`
	Function string `json:"function,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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