Documentation ¶
Index ¶
- Constants
- Variables
- func LifecycleStateKeyStrMapping() map[string]string
- func MappingPrefixes(mapping map[string]string) []string
- func Proto2JSON(serialized []byte, target proto.Message) ([]byte, error)
- func RemoveBytesNullBytes(str []byte) []byte
- func RemoveStringNullBytes(str string) string
- func ReplaceBytesU0000ToNullBytes(str []byte) []byte
- func ReplaceStringNullBytesToSeparator(str string) string
- func ReplaceStringSeparatorToNullBytes(str string) string
- type Action
- type ActionOpt
- func WithActionPayloadTransformer(actionTransformers ...ActionPayloadTransformer) ActionOpt
- func WithEventTransformer(eventTransformers ...EventTransformer) ActionOpt
- func WithInputArgsTransformer(inputArgsTransformers ...InputArgsTransformer) ActionOpt
- func WithKVReadTransformer(kvReadTransformers ...KVReadTransformer) ActionOpt
- func WithKVWriteTransformer(kvWriteTransformers ...KVWriteTransformer) ActionOpt
- type ActionPayload
- type ActionPayloadMatch
- type ActionPayloadMutate
- type ActionPayloadTransformer
- type Event
- type EventMatch
- type EventMutate
- type EventTransformer
- type InputArgs
- type InputArgsMatch
- type InputArgsMutate
- type InputArgsTransformer
- type KVRead
- func KVReadKeyObjectTypeReplaceByMap(mapping map[string]string, additionalMutators ...KVReadMutate) *KVRead
- func KVReadKeyReplace(mapping map[string]string, additionalMutators ...KVReadMutate) *KVRead
- func KVReadMutatorWithKeyPrefix(prefix string, mutator KVReadMutate) *KVRead
- func KVReadProtoWithKeyPrefix(prefix string, target proto.Message) *KVRead
- func NewKVRead(match KVReadMatch, mutators ...KVReadMutate) *KVRead
- type KVReadMatch
- type KVReadMutate
- type KVReadTransformer
- type KVWrite
- func KVWriteKeyObjectTypeReplaceByMap(mapping map[string]string, additionalMutators ...KVWriteMutate) *KVWrite
- func KVWriteKeyReplace(mapping map[string]string, additionalMutators ...KVWriteMutate) *KVWrite
- func KVWriteMutatorWithKeyPrefix(prefix string, mutator KVWriteMutate) *KVWrite
- func KVWriteProtoWithKeyPrefix(prefix string, target proto.Message) *KVWrite
- func NewKVWrite(match KVWriteMatch, mutators ...KVWriteMutate) *KVWrite
- type KVWriteMatch
- type KVWriteMutate
- type KVWriteTransformer
- type TxActionMatch
- func TxChaincodeAnyMatch() TxActionMatch
- func TxChaincodeIDMatch(chaincode string) TxActionMatch
- func TxChaincodeIDNotMatch(chaincode string) TxActionMatch
- func TxChaincodePatternsIDRegexpExclude(chaincodePatterns ...string) TxActionMatch
- func TxChaincodesIDMatch(chaincodes ...string) TxActionMatch
- func TxChaincodesIDRegexp(chaincodePattern string) TxActionMatch
- func TxChaincodesIDRegexpExclude(chaincodePattern string) TxActionMatch
- type TxActionMutate
Constants ¶
View Source
const ( LifecycleChaincodeName = "_lifecycle" // MetadataPrefix - this is the prefix of the state key, which stores information about the keys // in the corresponding namespace. Each committed chaincode in the channel has this state MetadataPrefix = "namespaces/metadata" // FieldsPrefix - prefix of the state key, which stores the parameters // of the committed chaincode in the channel FieldsPrefix = "namespaces/fields" // CollectionField ValidationInfoField EndorsementInfoField SequenceField - state key suffixes // that store the parameters of the committed chaincode in the channel CollectionField = "Collections" ValidationInfoField = "ValidationInfo" EndorsementInfoField = "EndorsementInfo" SequenceField = "Sequence" Collection = FieldsPrefix + "/" + CollectionField ValidationInfo = FieldsPrefix + "/" + ValidationInfoField EndorsementInfo = FieldsPrefix + "/" + EndorsementInfoField Sequence = FieldsPrefix + "/" + SequenceField )
Variables ¶
View Source
var LifecycleTransformers = []hlfproto.Transformer{ NewAction( TxChaincodeIDMatch(LifecycleChaincodeName), WithKVWriteTransformer( KVWriteKeyReplace(LifecycleStateKeyStrMapping(), func(write *kvrwset.KVWrite) error { write.Key = keyReplace(write.Key) return nil }), ), ), NewAction( TxChaincodeAnyMatch(), WithKVReadTransformer( KVReadKeyReplace(LifecycleStateKeyStrMapping(), func(read *kvrwset.KVRead) error { read.Key = keyReplace(read.Key) return nil }), ), ), }
Functions ¶
func MappingPrefixes ¶
func RemoveBytesNullBytes ¶
func RemoveStringNullBytes ¶
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
func NewAction ¶
func NewAction(actionMach TxActionMatch, opts ...ActionOpt) *Action
type ActionOpt ¶
type ActionOpt func(*Action)
func WithActionPayloadTransformer ¶
func WithActionPayloadTransformer(actionTransformers ...ActionPayloadTransformer) ActionOpt
func WithEventTransformer ¶
func WithEventTransformer(eventTransformers ...EventTransformer) ActionOpt
func WithInputArgsTransformer ¶
func WithInputArgsTransformer(inputArgsTransformers ...InputArgsTransformer) ActionOpt
func WithKVReadTransformer ¶
func WithKVReadTransformer(kvReadTransformers ...KVReadTransformer) ActionOpt
func WithKVWriteTransformer ¶
func WithKVWriteTransformer(kvWriteTransformers ...KVWriteTransformer) ActionOpt
type ActionPayload ¶
type ActionPayload struct {
// contains filtered or unexported fields
}
func ActionPayloadProto ¶
func ActionPayloadProto(methodName string, txAction proto.Message) *ActionPayload
func NewActionPayload ¶
func NewActionPayload(match ActionPayloadMatch, mutators ...ActionPayloadMutate) *ActionPayload
func (*ActionPayload) Transform ¶
func (action *ActionPayload) Transform(txAction *hlfproto.TransactionAction) error
type ActionPayloadMatch ¶
func ActionPayloadMatchFunc ¶
func ActionPayloadMatchFunc(str string) ActionPayloadMatch
type ActionPayloadMutate ¶
type ActionPayloadMutate func(*hlfproto.TransactionAction) error
func ActionPayloadMutateProto ¶
func ActionPayloadMutateProto(target proto.Message) ActionPayloadMutate
type ActionPayloadTransformer ¶
type ActionPayloadTransformer interface {
Transform(*hlfproto.TransactionAction) error
}
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func NewEvent ¶
func NewEvent(match EventMatch, mutate EventMutate) *Event
type EventMatch ¶
func EventMatchFunc ¶
func EventMatchFunc(str string) EventMatch
type EventMutate ¶
type EventMutate func(*peer.ChaincodeEvent) error
func EventMutateProto ¶
func EventMutateProto(target proto.Message) EventMutate
type EventTransformer ¶
type EventTransformer interface {
Transform(*peer.ChaincodeEvent) error
}
type InputArgs ¶
type InputArgs struct {
// contains filtered or unexported fields
}
func NewInputArgs ¶
func NewInputArgs(match InputArgsMatch, mutate InputArgsMutate) *InputArgs
type InputArgsMatch ¶
func InputArgsMatchFunc ¶
func InputArgsMatchFunc(fn string) InputArgsMatch
func InputArgsMatchString ¶
func InputArgsMatchString(pos int, str string) InputArgsMatch
type InputArgsMutate ¶
func InputArgsMutateProto ¶
func InputArgsMutateProto(target proto.Message) InputArgsMutate
func InputArgsMutateProtoAtPos ¶
func InputArgsMutateProtoAtPos(target proto.Message, pos int) InputArgsMutate
type InputArgsTransformer ¶
type KVRead ¶
type KVRead struct {
// contains filtered or unexported fields
}
func KVReadKeyObjectTypeReplaceByMap ¶
func KVReadKeyObjectTypeReplaceByMap(mapping map[string]string, additionalMutators ...KVReadMutate) *KVRead
func KVReadKeyReplace ¶
func KVReadKeyReplace(mapping map[string]string, additionalMutators ...KVReadMutate) *KVRead
func KVReadMutatorWithKeyPrefix ¶
func KVReadMutatorWithKeyPrefix(prefix string, mutator KVReadMutate) *KVRead
func NewKVRead ¶
func NewKVRead(match KVReadMatch, mutators ...KVReadMutate) *KVRead
type KVReadMatch ¶
func KVReadMatchKey ¶
func KVReadMatchKey(contents ...string) KVReadMatch
func KVReadMatchKeyPrefix ¶
func KVReadMatchKeyPrefix(prefixes ...string) KVReadMatch
type KVReadMutate ¶
func KVReadKeyReplacer ¶
func KVReadKeyReplacer(mapping map[string]string) KVReadMutate
type KVReadTransformer ¶
type KVWrite ¶
type KVWrite struct {
// contains filtered or unexported fields
}
func KVWriteKeyObjectTypeReplaceByMap ¶
func KVWriteKeyObjectTypeReplaceByMap(mapping map[string]string, additionalMutators ...KVWriteMutate) *KVWrite
func KVWriteKeyReplace ¶
func KVWriteKeyReplace(mapping map[string]string, additionalMutators ...KVWriteMutate) *KVWrite
func KVWriteMutatorWithKeyPrefix ¶
func KVWriteMutatorWithKeyPrefix(prefix string, mutator KVWriteMutate) *KVWrite
func NewKVWrite ¶
func NewKVWrite(match KVWriteMatch, mutators ...KVWriteMutate) *KVWrite
type KVWriteMatch ¶
func KVWriteMatchKey ¶
func KVWriteMatchKey(contents ...string) KVWriteMatch
func KVWriteMatchKeyPrefix ¶
func KVWriteMatchKeyPrefix(prefixes ...string) KVWriteMatch
type KVWriteMutate ¶
func KVWriteKeyReplacer ¶
func KVWriteKeyReplacer(mapping map[string]string) KVWriteMutate
func KVWriteMutateProto ¶
func KVWriteMutateProto(target proto.Message) KVWriteMutate
type KVWriteTransformer ¶
type TxActionMatch ¶
type TxActionMatch func(*hlfproto.TransactionAction) bool
func TxChaincodeAnyMatch ¶
func TxChaincodeAnyMatch() TxActionMatch
func TxChaincodeIDMatch ¶
func TxChaincodeIDMatch(chaincode string) TxActionMatch
func TxChaincodeIDNotMatch ¶
func TxChaincodeIDNotMatch(chaincode string) TxActionMatch
func TxChaincodePatternsIDRegexpExclude ¶
func TxChaincodePatternsIDRegexpExclude(chaincodePatterns ...string) TxActionMatch
func TxChaincodesIDMatch ¶
func TxChaincodesIDMatch(chaincodes ...string) TxActionMatch
func TxChaincodesIDRegexp ¶
func TxChaincodesIDRegexp(chaincodePattern string) TxActionMatch
func TxChaincodesIDRegexpExclude ¶
func TxChaincodesIDRegexpExclude(chaincodePattern string) TxActionMatch
type TxActionMutate ¶
type TxActionMutate func(*hlfproto.TransactionAction)
Click to show internal directories.
Click to hide internal directories.