Documentation ¶
Overview ¶
Package vectors sists in internal because it also contains code to produce bad/invalid messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bad ¶
Bad vector file has a bunch of different cases. each containing a list of entries of a single author feed.
type BadCase ¶
type BadCase struct { Description string Metadata []interface{} `json:",omitempty"` Entries []EntryBad }
BadCase describes a single case with a list of entries
type EntryBad ¶
type EntryBad struct { // EncodedData holds the bencode data as a hex string EncodedData HexString // Invalid denotes if a message is valid ot not. // sometimes we need a valid message preceeding an invalid one. // if message:2 has an invalid previous, for example. Invalid bool // if invalid, why the data is bad Reason string }
EntryBad is a signle message in a case In the bad entries we just care if a message is broken or not. To cleanly check the contents of a message we have the Good vectors.
type EntryGood ¶
type EntryGood struct { // EncodedData holds the bencode data as a hex string EncodedData HexString Key refs.MessageRef Author refs.FeedRef Sequence int32 Previous *refs.MessageRef Timestamp int64 HighlevelContent interface{} Signature HexString }
EntryGood describes a single message
type Good ¶
type Good struct { // Description describes what this vector file is about Description string // Metadata holds additional values that are needed to recreate the entries Metadata []interface{} `json:",omitempty"` // Entries are the single messages on a feed Entries []EntryGood }
Good is the scaffolding for the whole vector file It's called good because all the entries are valid messages.
type HexMetadata ¶
HexMetadata is a general purpose metadata field that hex encodes some data
type HexString ¶
type HexString []byte
HexString can be used to turn a byteslice into a JSON hexadecimal string
func (HexString) MarshalJSON ¶
MarshalJSON turns the binary data into a hex string
func (*HexString) UnmarshalJSON ¶
UnmarshalJSON expects data to be a string with hexadecimal bytes inside
type SubfeedAuthor ¶
SubfeedAuthor can be used as metadata to signal a feed reference (@abcdefg.something)