Documentation ¶
Overview ¶
Package multimsg implements a margaret codec to encode multiple kinds of messages to disk. Currently _legacy_ and _gabbygrove_ but should be easily extendable.
Index ¶
- type AlterableLog
- type MargaretCodec
- type MessageType
- type MultiMessage
- func (mm MultiMessage) AsGabby() (*gabbygrove.Transfer, bool)
- func (mm MultiMessage) AsLegacy() (*legacy.StoredMessage, bool)
- func (mm MultiMessage) AsMetaFeed() (*metafeed.Message, bool)
- func (mm MultiMessage) MarshalBinary() ([]byte, error)
- func (mm MultiMessage) Received() time.Time
- func (mm *MultiMessage) UnmarshalBinary(data []byte) error
- type WrappedLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MargaretCodec ¶
type MargaretCodec struct{}
func (MargaretCodec) Marshal ¶
func (c MargaretCodec) Marshal(v interface{}) ([]byte, error)
func (MargaretCodec) NewDecoder ¶
func (c MargaretCodec) NewDecoder(r io.Reader) margaret.Decoder
func (MargaretCodec) NewEncoder ¶
func (c MargaretCodec) NewEncoder(w io.Writer) margaret.Encoder
func (MargaretCodec) Unmarshal ¶
func (c MargaretCodec) Unmarshal(data []byte) (interface{}, error)
type MultiMessage ¶
MultiMessage attempts to support multiple message formats in the same storage layer currently supports Proto and legacy
func NewMultiMessageFromKeyValRaw ¶ added in v0.2.1
func NewMultiMessageFromKeyValRaw(msg refs.KeyValueRaw, raw json.RawMessage) MultiMessage
func NewMultiMessageFromLegacy ¶
func NewMultiMessageFromLegacy(msg *legacy.StoredMessage) *MultiMessage
func (MultiMessage) AsGabby ¶
func (mm MultiMessage) AsGabby() (*gabbygrove.Transfer, bool)
func (MultiMessage) AsLegacy ¶
func (mm MultiMessage) AsLegacy() (*legacy.StoredMessage, bool)
func (MultiMessage) AsMetaFeed ¶ added in v0.2.1
func (mm MultiMessage) AsMetaFeed() (*metafeed.Message, bool)
func (MultiMessage) MarshalBinary ¶
func (mm MultiMessage) MarshalBinary() ([]byte, error)
func (MultiMessage) Received ¶
func (mm MultiMessage) Received() time.Time
func (*MultiMessage) UnmarshalBinary ¶
func (mm *MultiMessage) UnmarshalBinary(data []byte) error
type WrappedLog ¶
type WrappedLog struct { AlterableLog // contains filtered or unexported fields }
func NewWrappedLog ¶
func NewWrappedLog(in AlterableLog) *WrappedLog
func (WrappedLog) Append ¶
func (wl WrappedLog) Append(val interface{}) (int64, error)
Click to show internal directories.
Click to hide internal directories.