Documentation ¶
Index ¶
- func EqualMessage(a, b Message) bool
- type Envelope
- func (v *Envelope) Copy() *Envelope
- func (v *Envelope) CopyAsInterface() interface{}
- func (v *Envelope) Equal(u *Envelope) bool
- func (v *Envelope) IsValid() error
- func (v *Envelope) MarshalBinary() ([]byte, error)
- func (v *Envelope) MarshalJSON() ([]byte, error)
- func (e *Envelope) Normalize() ([]Message, error)
- func (v *Envelope) UnmarshalBinary(data []byte) error
- func (v *Envelope) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *Envelope) UnmarshalJSON(data []byte) error
- type Message
- type MessageType
- type MessageWithSignature
- type MessageWithTransaction
- type SequencedMessage
- func (v *SequencedMessage) Copy() *SequencedMessage
- func (v *SequencedMessage) CopyAsInterface() interface{}
- func (v *SequencedMessage) Equal(u *SequencedMessage) bool
- func (m *SequencedMessage) Hash() [32]byte
- func (m *SequencedMessage) ID() *url.TxID
- func (v *SequencedMessage) IsValid() error
- func (v *SequencedMessage) MarshalBinary() ([]byte, error)
- func (v *SequencedMessage) MarshalJSON() ([]byte, error)
- func (*SequencedMessage) Type() MessageType
- func (v *SequencedMessage) UnmarshalBinary(data []byte) error
- func (v *SequencedMessage) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SequencedMessage) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *SequencedMessage) UnmarshalJSON(data []byte) error
- func (m *SequencedMessage) Unwrap() Message
- type SyntheticMessage
- func (v *SyntheticMessage) Copy() *SyntheticMessage
- func (v *SyntheticMessage) CopyAsInterface() interface{}
- func (v *SyntheticMessage) Equal(u *SyntheticMessage) bool
- func (m *SyntheticMessage) Hash() [32]byte
- func (m *SyntheticMessage) ID() *url.TxID
- func (v *SyntheticMessage) IsValid() error
- func (v *SyntheticMessage) MarshalBinary() ([]byte, error)
- func (v *SyntheticMessage) MarshalJSON() ([]byte, error)
- func (*SyntheticMessage) Type() MessageType
- func (v *SyntheticMessage) UnmarshalBinary(data []byte) error
- func (v *SyntheticMessage) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SyntheticMessage) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *SyntheticMessage) UnmarshalJSON(data []byte) error
- func (m *SyntheticMessage) Unwrap() Message
- type UserSignature
- func (v *UserSignature) Copy() *UserSignature
- func (v *UserSignature) CopyAsInterface() interface{}
- func (v *UserSignature) Equal(u *UserSignature) bool
- func (m *UserSignature) GetSignature() protocol.Signature
- func (m *UserSignature) GetTxID() *url.TxID
- func (m *UserSignature) Hash() [32]byte
- func (m *UserSignature) ID() *url.TxID
- func (v *UserSignature) IsValid() error
- func (v *UserSignature) MarshalBinary() ([]byte, error)
- func (v *UserSignature) MarshalJSON() ([]byte, error)
- func (*UserSignature) Type() MessageType
- func (v *UserSignature) UnmarshalBinary(data []byte) error
- func (v *UserSignature) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *UserSignature) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *UserSignature) UnmarshalJSON(data []byte) error
- type UserTransaction
- func (v *UserTransaction) Copy() *UserTransaction
- func (v *UserTransaction) CopyAsInterface() interface{}
- func (v *UserTransaction) Equal(u *UserTransaction) bool
- func (m *UserTransaction) GetTransaction() *protocol.Transaction
- func (m *UserTransaction) Hash() [32]byte
- func (m *UserTransaction) ID() *url.TxID
- func (v *UserTransaction) IsValid() error
- func (v *UserTransaction) MarshalBinary() ([]byte, error)
- func (v *UserTransaction) MarshalJSON() ([]byte, error)
- func (*UserTransaction) Type() MessageType
- func (v *UserTransaction) UnmarshalBinary(data []byte) error
- func (v *UserTransaction) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *UserTransaction) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *UserTransaction) UnmarshalJSON(data []byte) error
- type ValidatorSignature
- func (v *ValidatorSignature) Copy() *ValidatorSignature
- func (v *ValidatorSignature) CopyAsInterface() interface{}
- func (v *ValidatorSignature) Equal(u *ValidatorSignature) bool
- func (m *ValidatorSignature) GetSignature() protocol.Signature
- func (m *ValidatorSignature) GetTxID() *url.TxID
- func (m *ValidatorSignature) Hash() [32]byte
- func (m *ValidatorSignature) ID() *url.TxID
- func (v *ValidatorSignature) IsValid() error
- func (v *ValidatorSignature) MarshalBinary() ([]byte, error)
- func (v *ValidatorSignature) MarshalJSON() ([]byte, error)
- func (*ValidatorSignature) Type() MessageType
- func (v *ValidatorSignature) UnmarshalBinary(data []byte) error
- func (v *ValidatorSignature) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *ValidatorSignature) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *ValidatorSignature) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualMessage ¶
EqualMessage is used to compare the values of the union
Types ¶
type Envelope ¶
type Envelope struct { Signatures []protocol.Signature `json:"signatures,omitempty" form:"signatures" query:"signatures" validate:"required"` TxHash []byte `json:"txHash,omitempty" form:"txHash" query:"txHash"` Transaction []*protocol.Transaction `json:"transaction,omitempty" form:"transaction" query:"transaction"` Messages []Message `json:"messages,omitempty" form:"messages" query:"messages"` // contains filtered or unexported fields }
func (*Envelope) CopyAsInterface ¶
func (v *Envelope) CopyAsInterface() interface{}
func (*Envelope) MarshalBinary ¶
func (*Envelope) MarshalJSON ¶
func (*Envelope) UnmarshalBinary ¶
func (*Envelope) UnmarshalJSON ¶
type Message ¶
type Message interface { encoding.UnionValue // ID is the ID of the message. ID() *url.TxID // Type is the type of the message. Type() MessageType // Hash returns the hash of the message. Hash() [32]byte }
A Message is signature, transaction, or other message that may be sent to Accumulate to be processed.
func NewMessage ¶
func NewMessage(typ MessageType) (Message, error)
NewMessage creates a new Message for the specified MessageType.
func UnmarshalMessage ¶
UnmarshalMessage unmarshals a Message.
func UnmarshalMessageFrom ¶
UnmarshalMessageFrom unmarshals a Message.
func UnmarshalMessageJSON ¶
UnmarshalMessageJson unmarshals a Message.
type MessageType ¶
type MessageType int
MessageType is the type of a Message.
const MessageTypeSequenced MessageType = 5
MessageTypeSequenced is a message that is part of a sequence.
const MessageTypeSynthetic MessageType = 3
MessageTypeSynthetic is a message produced by the protocol, requiring proof.
const MessageTypeUserSignature MessageType = 2
MessageTypeUserSignature is a key signature from a user.
const MessageTypeUserTransaction MessageType = 1
MessageTypeUserTransaction is a transaction from a user.
const MessageTypeValidatorSignature MessageType = 4
MessageTypeValidatorSignature is a key signature from a validator.
func MessageTypeByName ¶
func MessageTypeByName(name string) (MessageType, bool)
MessageTypeByName returns the named Message Type.
func (MessageType) GetEnumValue ¶
func (v MessageType) GetEnumValue() uint64
GetEnumValue returns the value of the Message Type
func (MessageType) MarshalJSON ¶
func (v MessageType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Message Type to JSON as a string.
func (*MessageType) SetEnumValue ¶
func (v *MessageType) SetEnumValue(id uint64) bool
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (MessageType) String ¶
func (v MessageType) String() string
String returns the name of the Message Type.
func (*MessageType) UnmarshalJSON ¶
func (v *MessageType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the Message Type from JSON as a string.
type MessageWithSignature ¶
type MessageWithTransaction ¶
type MessageWithTransaction interface { Message GetTransaction() *protocol.Transaction }
type SequencedMessage ¶
type SequencedMessage struct { Message Message `json:"message,omitempty" form:"message" query:"message" validate:"required"` // Source is the source that produced the transaction. Source *url.URL `json:"source,omitempty" form:"source" query:"source"` // Destination is the destination that the transaction is sent to. Destination *url.URL `json:"destination,omitempty" form:"destination" query:"destination"` // Number is the sequence number of the transaction. Number uint64 `json:"number,omitempty" form:"number" query:"number"` // contains filtered or unexported fields }
func (*SequencedMessage) Copy ¶
func (v *SequencedMessage) Copy() *SequencedMessage
func (*SequencedMessage) CopyAsInterface ¶
func (v *SequencedMessage) CopyAsInterface() interface{}
func (*SequencedMessage) Equal ¶
func (v *SequencedMessage) Equal(u *SequencedMessage) bool
func (*SequencedMessage) Hash ¶
func (m *SequencedMessage) Hash() [32]byte
func (*SequencedMessage) ID ¶
func (m *SequencedMessage) ID() *url.TxID
func (*SequencedMessage) IsValid ¶
func (v *SequencedMessage) IsValid() error
func (*SequencedMessage) MarshalBinary ¶
func (v *SequencedMessage) MarshalBinary() ([]byte, error)
func (*SequencedMessage) MarshalJSON ¶
func (v *SequencedMessage) MarshalJSON() ([]byte, error)
func (*SequencedMessage) Type ¶
func (*SequencedMessage) Type() MessageType
func (*SequencedMessage) UnmarshalBinary ¶
func (v *SequencedMessage) UnmarshalBinary(data []byte) error
func (*SequencedMessage) UnmarshalBinaryFrom ¶
func (v *SequencedMessage) UnmarshalBinaryFrom(rd io.Reader) error
func (*SequencedMessage) UnmarshalFieldsFrom ¶
func (v *SequencedMessage) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*SequencedMessage) UnmarshalJSON ¶
func (v *SequencedMessage) UnmarshalJSON(data []byte) error
func (*SequencedMessage) Unwrap ¶
func (m *SequencedMessage) Unwrap() Message
type SyntheticMessage ¶
type SyntheticMessage struct { Message Message `json:"message,omitempty" form:"message" query:"message" validate:"required"` Proof *protocol.AnnotatedReceipt `json:"proof,omitempty" form:"proof" query:"proof" validate:"required"` // contains filtered or unexported fields }
func (*SyntheticMessage) Copy ¶
func (v *SyntheticMessage) Copy() *SyntheticMessage
func (*SyntheticMessage) CopyAsInterface ¶
func (v *SyntheticMessage) CopyAsInterface() interface{}
func (*SyntheticMessage) Equal ¶
func (v *SyntheticMessage) Equal(u *SyntheticMessage) bool
func (*SyntheticMessage) Hash ¶
func (m *SyntheticMessage) Hash() [32]byte
func (*SyntheticMessage) ID ¶
func (m *SyntheticMessage) ID() *url.TxID
func (*SyntheticMessage) IsValid ¶
func (v *SyntheticMessage) IsValid() error
func (*SyntheticMessage) MarshalBinary ¶
func (v *SyntheticMessage) MarshalBinary() ([]byte, error)
func (*SyntheticMessage) MarshalJSON ¶
func (v *SyntheticMessage) MarshalJSON() ([]byte, error)
func (*SyntheticMessage) Type ¶
func (*SyntheticMessage) Type() MessageType
func (*SyntheticMessage) UnmarshalBinary ¶
func (v *SyntheticMessage) UnmarshalBinary(data []byte) error
func (*SyntheticMessage) UnmarshalBinaryFrom ¶
func (v *SyntheticMessage) UnmarshalBinaryFrom(rd io.Reader) error
func (*SyntheticMessage) UnmarshalFieldsFrom ¶
func (v *SyntheticMessage) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*SyntheticMessage) UnmarshalJSON ¶
func (v *SyntheticMessage) UnmarshalJSON(data []byte) error
func (*SyntheticMessage) Unwrap ¶
func (m *SyntheticMessage) Unwrap() Message
type UserSignature ¶
type UserSignature struct { Signature protocol.Signature `json:"signature,omitempty" form:"signature" query:"signature" validate:"required"` TxID *url.TxID `json:"txID,omitempty" form:"txID" query:"txID" validate:"required"` // contains filtered or unexported fields }
func (*UserSignature) Copy ¶
func (v *UserSignature) Copy() *UserSignature
func (*UserSignature) CopyAsInterface ¶
func (v *UserSignature) CopyAsInterface() interface{}
func (*UserSignature) Equal ¶
func (v *UserSignature) Equal(u *UserSignature) bool
func (*UserSignature) GetSignature ¶
func (m *UserSignature) GetSignature() protocol.Signature
func (*UserSignature) GetTxID ¶
func (m *UserSignature) GetTxID() *url.TxID
func (*UserSignature) Hash ¶
func (m *UserSignature) Hash() [32]byte
func (*UserSignature) ID ¶
func (m *UserSignature) ID() *url.TxID
func (*UserSignature) IsValid ¶
func (v *UserSignature) IsValid() error
func (*UserSignature) MarshalBinary ¶
func (v *UserSignature) MarshalBinary() ([]byte, error)
func (*UserSignature) MarshalJSON ¶
func (v *UserSignature) MarshalJSON() ([]byte, error)
func (*UserSignature) Type ¶
func (*UserSignature) Type() MessageType
func (*UserSignature) UnmarshalBinary ¶
func (v *UserSignature) UnmarshalBinary(data []byte) error
func (*UserSignature) UnmarshalBinaryFrom ¶
func (v *UserSignature) UnmarshalBinaryFrom(rd io.Reader) error
func (*UserSignature) UnmarshalFieldsFrom ¶
func (v *UserSignature) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*UserSignature) UnmarshalJSON ¶
func (v *UserSignature) UnmarshalJSON(data []byte) error
type UserTransaction ¶
type UserTransaction struct { Transaction *protocol.Transaction `json:"transaction,omitempty" form:"transaction" query:"transaction" validate:"required"` // contains filtered or unexported fields }
func (*UserTransaction) Copy ¶
func (v *UserTransaction) Copy() *UserTransaction
func (*UserTransaction) CopyAsInterface ¶
func (v *UserTransaction) CopyAsInterface() interface{}
func (*UserTransaction) Equal ¶
func (v *UserTransaction) Equal(u *UserTransaction) bool
func (*UserTransaction) GetTransaction ¶
func (m *UserTransaction) GetTransaction() *protocol.Transaction
func (*UserTransaction) Hash ¶
func (m *UserTransaction) Hash() [32]byte
func (*UserTransaction) ID ¶
func (m *UserTransaction) ID() *url.TxID
func (*UserTransaction) IsValid ¶
func (v *UserTransaction) IsValid() error
func (*UserTransaction) MarshalBinary ¶
func (v *UserTransaction) MarshalBinary() ([]byte, error)
func (*UserTransaction) MarshalJSON ¶
func (v *UserTransaction) MarshalJSON() ([]byte, error)
func (*UserTransaction) Type ¶
func (*UserTransaction) Type() MessageType
func (*UserTransaction) UnmarshalBinary ¶
func (v *UserTransaction) UnmarshalBinary(data []byte) error
func (*UserTransaction) UnmarshalBinaryFrom ¶
func (v *UserTransaction) UnmarshalBinaryFrom(rd io.Reader) error
func (*UserTransaction) UnmarshalFieldsFrom ¶
func (v *UserTransaction) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*UserTransaction) UnmarshalJSON ¶
func (v *UserTransaction) UnmarshalJSON(data []byte) error
type ValidatorSignature ¶
type ValidatorSignature struct { Signature protocol.KeySignature `json:"signature,omitempty" form:"signature" query:"signature" validate:"required"` Source *url.URL `json:"source,omitempty" form:"source" query:"source" validate:"required"` // contains filtered or unexported fields }
func (*ValidatorSignature) Copy ¶
func (v *ValidatorSignature) Copy() *ValidatorSignature
func (*ValidatorSignature) CopyAsInterface ¶
func (v *ValidatorSignature) CopyAsInterface() interface{}
func (*ValidatorSignature) Equal ¶
func (v *ValidatorSignature) Equal(u *ValidatorSignature) bool
func (*ValidatorSignature) GetSignature ¶
func (m *ValidatorSignature) GetSignature() protocol.Signature
func (*ValidatorSignature) GetTxID ¶
func (m *ValidatorSignature) GetTxID() *url.TxID
func (*ValidatorSignature) Hash ¶
func (m *ValidatorSignature) Hash() [32]byte
func (*ValidatorSignature) ID ¶
func (m *ValidatorSignature) ID() *url.TxID
func (*ValidatorSignature) IsValid ¶
func (v *ValidatorSignature) IsValid() error
func (*ValidatorSignature) MarshalBinary ¶
func (v *ValidatorSignature) MarshalBinary() ([]byte, error)
func (*ValidatorSignature) MarshalJSON ¶
func (v *ValidatorSignature) MarshalJSON() ([]byte, error)
func (*ValidatorSignature) Type ¶
func (*ValidatorSignature) Type() MessageType
func (*ValidatorSignature) UnmarshalBinary ¶
func (v *ValidatorSignature) UnmarshalBinary(data []byte) error
func (*ValidatorSignature) UnmarshalBinaryFrom ¶
func (v *ValidatorSignature) UnmarshalBinaryFrom(rd io.Reader) error
func (*ValidatorSignature) UnmarshalFieldsFrom ¶
func (v *ValidatorSignature) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*ValidatorSignature) UnmarshalJSON ¶
func (v *ValidatorSignature) UnmarshalJSON(data []byte) error