fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/common/tools/protolator Index | Files | Directories

package protolator

import "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/common/tools/protolator"

Index

Package Files

api.go dynamic.go json.go nested.go statically_opaque.go variably_opaque.go

func DeepMarshalJSON Uses

func DeepMarshalJSON(w io.Writer, msg proto.Message) error

DeepMarshalJSON marshals msg to w as JSON, but instead of marshaling bytes fields which contain nested marshaled messages as base64 (like the standard proto encoding), these nested messages are remarshaled as the JSON representation of those messages. This is done so that the JSON representation is as non-binary and human readable as possible.

func DeepUnmarshalJSON Uses

func DeepUnmarshalJSON(r io.Reader, msg proto.Message) error

DeepUnmarshalJSON takes JSON output as generated by DeepMarshalJSON and decodes it into msg This includes re-marshaling the expanded nested elements to binary form

func MostlyDeterministicMarshal Uses

func MostlyDeterministicMarshal(msg proto.Message) ([]byte, error)

MostlyDeterministicMarshal is _NOT_ the function you are looking for. It causes protobuf serialization consistent within a single build. It does not guarantee that the serialization is deterministic across proto versions or proto implementations. It is useful for situations where the same process wants to compare binary messages for equality without needing to unmarshal first, but should not be used generally.

type DecoratedProto Uses

type DecoratedProto interface {
    // Underlying returns the underlying proto message which is being dynamically decorated
    Underlying() proto.Message
}

DecoratedProto should be implemented by the dynamic wrappers applied by the Dynamic*FieldProto interfaces This is necessary for the proto system to unmarshal, because it discovers proto message type by reflection (Rather than by interface definition as it probably should ( https://github.com/golang/protobuf/issues/291 )

type DynamicFieldProto Uses

type DynamicFieldProto interface {
    // DynamicFields returns the field names which are dynamic
    DynamicFields() []string

    // DynamicFieldProto returns a newly allocated dynamic message, decorating an underlying
    // proto message with the runtime determined function
    DynamicFieldProto(name string, underlying proto.Message) (proto.Message, error)
}

DynamicFieldProto should be implemented by protos which have nested fields whose attributes (such as their opaque types) cannot be determined until runtime

type DynamicMapFieldProto Uses

type DynamicMapFieldProto interface {
    // DynamicMapFields returns the field names which are dynamic
    DynamicMapFields() []string

    // DynamicMapFieldProto returns a newly allocated dynamic message, decorating an underlying
    // proto message with the runtime determined function
    DynamicMapFieldProto(name string, key string, underlying proto.Message) (proto.Message, error)
}

DynamicMapFieldProto should be implemented by protos which have maps to messages whose attributes (such as their opaque types) cannot be determined until runtime

type DynamicSliceFieldProto Uses

type DynamicSliceFieldProto interface {
    // DynamicSliceFields returns the field names which are dynamic
    DynamicSliceFields() []string

    // DynamicSliceFieldProto returns a newly allocated dynamic message, decorating an underlying
    // proto message with the runtime determined function
    DynamicSliceFieldProto(name string, index int, underlying proto.Message) (proto.Message, error)
}

DynamicSliceFieldProto should be implemented by protos which have slices of messages whose attributes (such as their opaque types) cannot be determined until runtime

type StaticallyOpaqueFieldProto Uses

type StaticallyOpaqueFieldProto interface {
    // StaticallyOpaqueFields returns the field names which contain opaque data
    StaticallyOpaqueFields() []string

    // StaticallyOpaqueFieldProto returns a newly allocated proto message of the correct
    // type for the field name.
    StaticallyOpaqueFieldProto(name string) (proto.Message, error)
}

StaticallyOpaqueFieldProto should be implemented by protos which have bytes fields which are the marshaled value of a fixed type

type StaticallyOpaqueMapFieldProto Uses

type StaticallyOpaqueMapFieldProto interface {
    // StaticallyOpaqueMapFields returns the field names which contain opaque data
    StaticallyOpaqueMapFields() []string

    // StaticallyOpaqueMapFieldProto returns a newly allocated proto message of the correct
    // type for the field name.
    StaticallyOpaqueMapFieldProto(name string, key string) (proto.Message, error)
}

StaticallyOpaqueMapFieldProto should be implemented by protos which have maps to bytes fields which are the marshaled value of a fixed type

type StaticallyOpaqueSliceFieldProto Uses

type StaticallyOpaqueSliceFieldProto interface {
    // StaticallyOpaqueSliceFields returns the field names which contain opaque data
    StaticallyOpaqueSliceFields() []string

    // StaticallyOpaqueSliceFieldProto returns a newly allocated proto message of the correct
    // type for the field name.
    StaticallyOpaqueSliceFieldProto(name string, index int) (proto.Message, error)
}

StaticallyOpaqueSliceFieldProto should be implemented by protos which have maps to bytes fields which are the marshaled value of a fixed type

type VariablyOpaqueFieldProto Uses

type VariablyOpaqueFieldProto interface {
    // VariablyOpaqueFields returns the field names which contain opaque data
    VariablyOpaqueFields() []string

    // VariablyOpaqueFieldProto returns a newly allocated proto message of the correct
    // type for the field name.
    VariablyOpaqueFieldProto(name string) (proto.Message, error)
}

VariablyOpaqueFieldProto should be implemented by protos which have bytes fields which are the marshaled value depends upon the other contents of the proto

type VariablyOpaqueMapFieldProto Uses

type VariablyOpaqueMapFieldProto interface {
    // VariablyOpaqueMapFields returns the field names which contain opaque data
    VariablyOpaqueMapFields() []string

    // VariablyOpaqueMapFieldProto returns a newly allocated proto message of the correct
    // type for the field name.
    VariablyOpaqueMapFieldProto(name string, key string) (proto.Message, error)
}

VariablyOpaqueMapFieldProto should be implemented by protos which have maps to bytes fields which are the marshaled value of a a message type determined by the other contents of the proto

type VariablyOpaqueSliceFieldProto Uses

type VariablyOpaqueSliceFieldProto interface {
    // VariablyOpaqueSliceFields returns the field names which contain opaque data
    VariablyOpaqueSliceFields() []string

    // VariablyOpaqueFieldProto returns a newly allocated proto message of the correct
    // type for the field name.
    VariablyOpaqueSliceFieldProto(name string, index int) (proto.Message, error)
}

VariablyOpaqueSliceFieldProto should be implemented by protos which have maps to bytes fields which are the marshaled value of a a message type determined by the other contents of the proto

Directories

PathSynopsis
protoext
protoext/commonext
protoext/ledger/rwsetext
protoext/mspext
protoext/ordererext
protoext/peerext

Package protolator imports 10 packages (graph) and is imported by 2 packages. Updated 2019-09-05. Refresh now. Tools for package owners.