Documentation
¶
Index ¶
- Constants
- Variables
- func CreatedAtVars() (ca *types.Uint64, ser *types.Uint40)
- func EventVars() (ser *types.Uint40)
- func FullIdPubkeyVars() (ser *types.Uint40, fid *types.Id, p *types.PubHash, ca *types.Uint64)
- func IdVars() (id *types.IdHash, ser *types.Uint40)
- func Identify(r io.Reader) (i int, err error)
- func KindPubkeyVars() (ki *types.Uint16, p *types.PubHash, ca *types.Uint64, ser *types.Uint40)
- func KindVars() (ki *types.Uint16, ca *types.Uint64, ser *types.Uint40)
- func PubkeyVars() (p *types.PubHash, ca *types.Uint64, ser *types.Uint40)
- func TagKindPubkeyVars() (k *types.Letter, v *types.Ident, ki *types.Uint16, p *types.PubHash, ...)
- func TagKindVars() (k *types.Letter, v *types.Ident, ki *types.Uint16, ca *types.Uint64, ...)
- func TagPubkeyVars() (k *types.Letter, v *types.Ident, p *types.PubHash, ca *types.Uint64, ...)
- func TagVars() (k *types.Letter, v *types.Ident, ca *types.Uint64, ser *types.Uint40)
- type Encs
- type I
- type P
- type T
- func CreatedAtDec(ca *types.Uint64, ser *types.Uint40) (enc *T)
- func CreatedAtEnc(ca *types.Uint64, ser *types.Uint40) (enc *T)
- func EventDec(ser *types.Uint40) (enc *T)
- func EventEnc(ser *types.Uint40) (enc *T)
- func FullIdPubkeyDec(ser *types.Uint40, fid *types.Id, p *types.PubHash, ca *types.Uint64) (enc *T)
- func FullIdPubkeyEnc(ser *types.Uint40, fid *types.Id, p *types.PubHash, ca *types.Uint64) (enc *T)
- func IdDec(id *types.IdHash, ser *types.Uint40) (enc *T)
- func IdEnc(id *types.IdHash, ser *types.Uint40) (enc *T)
- func KindDec(ki *types.Uint16, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func KindEnc(ki *types.Uint16, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func KindPubkeyDec(ki *types.Uint16, p *types.PubHash, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func KindPubkeyEnc(ki *types.Uint16, p *types.PubHash, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func New(encoders ...codec.I) (i *T)
- func PubkeyDec(p *types.PubHash, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func PubkeyEnc(p *types.PubHash, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func TagDec(k *types.Letter, v *types.Ident, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func TagEnc(k *types.Letter, v *types.Ident, ca *types.Uint64, ser *types.Uint40) (enc *T)
- func TagKindDec(k *types.Letter, v *types.Ident, ki *types.Uint16, ca *types.Uint64, ...) (enc *T)
- func TagKindEnc(k *types.Letter, v *types.Ident, ki *types.Uint16, ca *types.Uint64, ...) (enc *T)
- func TagKindPubkeyDec(k *types.Letter, v *types.Ident, ki *types.Uint16, p *types.PubHash, ...) (enc *T)
- func TagKindPubkeyEnc(k *types.Letter, v *types.Ident, ki *types.Uint16, p *types.PubHash, ...) (enc *T)
- func TagPubkeyDec(k *types.Letter, v *types.Ident, p *types.PubHash, ca *types.Uint64, ...) (enc *T)
- func TagPubkeyEnc(k *types.Letter, v *types.Ident, p *types.PubHash, ca *types.Uint64, ...) (enc *T)
Constants ¶
const ( EventPrefix = I("evt") IdPrefix = I("eid") FullIdPubkeyPrefix = I("fpc") // full id, pubkey, created at CreatedAtPrefix = I("c--") // created at KindPrefix = I("kc-") // kind, created at PubkeyPrefix = I("pc-") // pubkey, created at KindPubkeyPrefix = I("kpc") // kind, pubkey, created at TagPrefix = I("tc-") // tag, created at TagKindPrefix = I("tkc") // tag, kind, created at TagPubkeyPrefix = I("tpc") // tag, pubkey, created at TagKindPubkeyPrefix = I("tkp") // tag, kind, pubkey, created at )
Variables ¶
var CreatedAt = next()
CreatedAt is an index that allows search for the timestamp on the event.
3 prefix|8 timestamp|5 serial
var Event = next()
Event is the whole event stored in binary format
prefix|5 serial - event in binary format
var FullIdPubkey = next()
FullIdPubkey is an index designed to enable sorting and filtering of results found via other indexes, without having to decode the event.
3 prefix|5 serial|32 ID|8 pubkey hash|8 timestamp
var Id = next()
Id contains a truncated 8-byte hash of an event index. This is the secondary key of an event, the primary key is the serial found in the Event.
3 prefix|8 ID hash|5 serial
var Kind = next()
Kind
3 prefix|2 kind|8 timestamp|5 serial
var KindPubkey = next()
KindPubkey
3 prefix|2 kind|8 pubkey hash|8 timestamp|5 serial
var Pubkey = next()
Pubkey is a composite index that allows search by pubkey filtered by timestamp.
3 prefix|8 pubkey hash|8 timestamp|5 serial
var Tag = next()
Tag allows searching for a tag and filter by timestamp.
3 prefix|1 key letter|8 value hash|8 timestamp|5 serial
var TagKind = next()
TagKind
3 prefix|1 key letter|8 value hash|2 kind|8 timestamp|5 serial
var TagKindPubkey = next()
TagKindPubkey
3 prefix|1 key letter|8 value hash|2 kind|8 pubkey hash|8 bytes timestamp|5 byte serial
var TagPubkey = next()
TagPubkey allows searching for a pubkey, tag and timestamp.
3 prefix|1 key letter|8 value hash|8 pubkey hash|8 timestamp|5 serial
Functions ¶
func FullIdPubkeyVars ¶
func KindPubkeyVars ¶
func TagKindPubkeyVars ¶
func TagKindVars ¶
func TagPubkeyVars ¶
Types ¶
type I ¶
type I string
type T ¶
type T struct{ Encs }
T is a wrapper around an array of codec.I. The caller provides the Encs so they can then call the accessor methods of the codec.I implementation.
func FullIdPubkeyDec ¶
func FullIdPubkeyEnc ¶
func KindPubkeyDec ¶
func KindPubkeyEnc ¶
func New ¶
New creates a new indexes.T. The helper functions below have an encode and decode variant, the decode variant does not add the prefix encoder because it has been read by Identify or just is being read, and found because it was written for the prefix in the iteration.