common

package module
v0.0.0-...-104a8d5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: GPL-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

View Source
const (
	OK    = 200
	ERROR = 500
)
View Source
const (
	SUCCESS = "200"
	ERR1    = "AKC0001"
	ERR2    = "AKC0002"
	ERR3    = "AKC0003"
	ERR4    = "AKC0004"
	ERR5    = "AKC0005"
	ERR6    = "AKC0006"
	ERR7    = "AKC0007"
	ERR8    = "AKC0008"
	ERR9    = "AKC0009"
	ERR10   = "AKC0010"
	ERR11   = "AKC0011"
	ERR12   = "AKC0012"
	ERR13   = "AKC0013"
	ERR14   = "AKC0014"
	ERR15   = "AKC0015"
	ERR16   = "AKC0016"
	ERR17   = "AKC0017"
	ERR18   = "AKC0018"
)

Variables

View Source
var Logger = shim.NewLogger("logger")
View Source
var ResCodeDict = map[string]string{
	"200":     "OK",
	"AKC0001": "Cannot Update User Information!",
	"AKC0002": "Incorrect number of arguments!",
	"AKC0003": "Convert Json fail!",
	"AKC0004": "Get data fail!",
	"AKC0005": "Insert data fail!",
	"AKC0006": "Public key error!",
	"AKC0007": "ParsePKCS1PublicKey error!",
	"AKC0008": "Verify error!",
	"AKC0009": "Only signed once!",
	"AKC0010": "Not Enough Quorum",
	"AKC0011": "Only Commit once!",
	"AKC0012": "Proposal Commit not exist!",
	"AKC0013": "Proposal ID not exist!",
	"AKC0014": "Admin ID not exist!",
	"AKC0015": "Admin ID not Active!",
	"AKC0016": "Proposal Rejected!",
	"AKC0017": "You have confirmed you cannot reject!",
	"AKC0018": "Only reject once!",
}

Functions

func GetLine

func GetLine(depthList ...int) string

func GetQueryResultForQueryString

func GetQueryResultForQueryString(stub shim.ChaincodeStubInterface, queryString string) ([]byte, error)

func RespondError

func RespondError(err ResponseError) pb.Response

func RespondSuccess

func RespondSuccess(res ResponseSuccess) pb.Response

Types

type InvokeResponse

type InvokeResponse struct {
	Status string `json:"status"`
	Msg    string `json:"msg"`
	Rows   string `json:"rows"`
}

type ResponseError

type ResponseError struct {
	ResCode string
	Msg     string
}

type ResponseSuccess

type ResponseSuccess struct {
	ResCode string
	Msg     string
	Payload string
}

Jump to

Keyboard shortcuts

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