util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHttpServerRunning

func IsHttpServerRunning() bool

func MakeDefaultLocalCaller

func MakeDefaultLocalCaller() (rpc.Caller, error)

func MakeLocalCaller

func MakeLocalCaller(cc string) (rpc.Caller, error)

specified the fabric-tier chaincode name, or "" to use the default one

func NormalEnd

func NormalEnd(rw web.ResponseWriter, v interface{})

func NormalError

func NormalError(rw web.ResponseWriter, e error)

func NormalErrorF

func NormalErrorF(rw web.ResponseWriter, code int, message string)

func ParseCompactFormTx

func ParseCompactFormTx(ctxstr string) (e error, flag string, method string, cc string, args [][]byte)

func StartHttpServer

func StartHttpServer(vp *viper.Viper, h http.Handler) error

deprecated

func StartHttpServerCustom

func StartHttpServerCustom(host string, port int, h http.Handler) error

func StopHttpServer

func StopHttpServer() error

Types

type FabricClientBase

type FabricClientBase struct {
	RespWrapping func(interface{}) interface{}
	// contains filtered or unexported fields
}

a null-base to provide more elastic

func (*FabricClientBase) Normal

func (s *FabricClientBase) Normal(rw web.ResponseWriter, v interface{})

func (*FabricClientBase) NormalError

func (s *FabricClientBase) NormalError(rw web.ResponseWriter, e error)

func (*FabricClientBase) NormalErrorF

func (s *FabricClientBase) NormalErrorF(rw web.ResponseWriter, code int, message string)

type FabricRPCBase

type FabricRPCBase struct {
	*FabricClientBase
	Caller rpc.Caller
}

type FabricRPCCore

type FabricRPCCore struct {
	*FabricRPCBase
	*txgen.TxGenerator
	ActivePrivk crypto.Signer
	// contains filtered or unexported fields
}

func (*FabricRPCCore) DefaultOutput

func (s *FabricRPCCore) DefaultOutput(e interface{})

func (*FabricRPCCore) DoSignature

func (s *FabricRPCCore) DoSignature(rw web.ResponseWriter, req *web.Request)

func (*FabricRPCCore) PrehandlePost

func (s *FabricRPCCore) PrehandlePost(rw web.ResponseWriter,
	req *web.Request, next web.NextMiddlewareFunc)

func (*FabricRPCCore) SendRawTx

func (s *FabricRPCCore) SendRawTx(rw web.ResponseWriter, req *web.Request)

type LocalCaller

type LocalCaller interface {
	Output() string
}

type RPCRouter

type RPCRouter struct {
	*web.Router
}

func CreateRPCRouter

func CreateRPCRouter(root *web.Router, path string) RPCRouter

func (RPCRouter) Init

func (r RPCRouter) Init(cf func() (rpc.Caller, error)) RPCRouter

type TxBatch

type TxBatch struct {
	*FabricRPCCore
	// contains filtered or unexported fields
}

func (*TxBatch) AcquireCaller

func (t *TxBatch) AcquireCaller() txgen.TxCaller

func (*TxBatch) AddBatchOut

func (t *TxBatch) AddBatchOut(v interface{})

type TxBatchRouter

type TxBatchRouter struct {
	*web.Router
}

func CreateBatchRouter

func CreateBatchRouter(root TxRouter, path string) TxBatchRouter

func (TxBatchRouter) Init

func (r TxBatchRouter) Init(methodName string) TxBatchRouter

type TxRouter

type TxRouter struct {
	*web.Router
}

func CreateTxRouter

func CreateTxRouter(root RPCRouter) TxRouter

func (TxRouter) BuildRoutes

func (r TxRouter) BuildRoutes()

func (TxRouter) Init

func (r TxRouter) Init(ccname string) TxRouter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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