param

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const LastPosKey = `_lastPos`

Variables

View Source
var ErrPayloadValidationError = errors.New(`payload validation`)

ErrPayloadValidationError occurs when payload validation not passed

View Source
var (
	ErrProtoExpected = errors.New(`protobuf expected`)
)

Functions

func Bool

func Bool(name string, argPoss ...int) router.MiddlewareFunc

Bool creates middleware for converting to bool chaincode method parameter

func Bytes

func Bytes(name string, argPoss ...int) router.MiddlewareFunc

Bytes creates middleware for converting to []byte chaincode method parameter

func Int

func Int(name string, argPoss ...int) router.MiddlewareFunc

Int creates middleware for converting to integer chaincode method parameter

func Param

func Param(name string, paramType interface{}, argPoss ...int) router.MiddlewareFunc

Param create middleware function for transforming stub arg to context arg

func PayloadValidationError

func PayloadValidationError(errs ...error) error

PayloadValidationError returns error with prefix

func Proto

func Proto(name string, target interface{}, argPoss ...int) router.MiddlewareFunc

Proto creates middleware for converting to protobuf chaincode method parameter

func StrictKnown

func StrictKnown(next router.HandlerFunc, pos ...int) router.HandlerFunc

StrictKnown allows passing arguments to chaincode func only if parameters are defined in router

func String

func String(name string, argPoss ...int) router.MiddlewareFunc

String creates middleware for converting to string chaincode method parameter

func Strings

func Strings(name string, argPoss ...int) router.MiddlewareFunc

func Struct

func Struct(name string, target interface{}, argPoss ...int) router.MiddlewareFunc

Struct creates middleware for converting to struct chaincode method parameter

func TypeErrorMiddleware

func TypeErrorMiddleware(name string, err error) router.MiddlewareFunc

Types

type MiddlewareFuncMap

type MiddlewareFuncMap map[string]router.MiddlewareFunc

MiddlewareFuncMap named list of middleware functions

func (MiddlewareFuncMap) Add

func (pbag MiddlewareFuncMap) Add(name string, paramType interface{}) MiddlewareFuncMap

Add middleware function

type Parameter

type Parameter struct {
	Name   string
	Type   interface{}
	ArgPos int
}

Parameter of chain code function

func (Parameter) ValueFromContext

func (p Parameter) ValueFromContext(c router.Context) (arg interface{}, err error)

type Parameters

type Parameters []Parameter

Parameters list of chain code function parameters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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