Documentation
¶
Overview ¶
Package store is an interface and ancillary helpers and types for defining a series of API elements for abstracting the event storage from the implementation.
It is composed so that the top-level interface can be partially implemented if need be.
Index ¶
- Variables
- type Accountant
- type Configuration
- type Configurationer
- type Deleter
- type EventIdSerialer
- type EventRef
- func (r EventRef) ID() ntypes.EventID
- func (r EventRef) IDHex() string
- func (r *EventRef) IDSlice() []byte
- func (r EventRef) Pub() ntypes.Pubkey
- func (r EventRef) PubHex() string
- func (r *EventRef) PubSlice() []byte
- func (r EventRef) Ser() uint64
- func (r EventRef) ToIdPkTs() *IdPkTs
- func (r EventRef) Ts() int64
- type Exporter
- type GetIdsWriter
- type I
- type IdPkTs
- type Importer
- type Initer
- type LogLeveler
- type OK
- type Pather
- type Querent
- type Querier
- type Req
- type Rescanner
- type Responder
- type Saver
- type SerialByIder
- type Syncer
- type Wiper
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
BlockList []string `json:"block_list" doc:"list of IP addresses that will be ignored"`
}
type Configurationer ¶
type Deleter ¶
type EventIdSerialer ¶
type EventRef ¶ added in v0.36.11
type EventRef struct {
// contains filtered or unexported fields
}
EventRef is a stack-friendly event reference using fixed-size arrays. Total size: 80 bytes (32+32+8+8), fits in a cache line, copies stay on stack. Use this type when you need safe, immutable event references.
func NewEventRef ¶ added in v0.36.11
NewEventRef creates an EventRef from byte slices. The slices are copied into fixed-size arrays.
func (EventRef) ID ¶ added in v0.36.11
ID returns the event ID (copy, stays on stack).
func (EventRef) IDHex ¶ added in v0.36.11
IDHex returns the event ID as lowercase hex.
func (*EventRef) IDSlice ¶ added in v0.36.11
IDSlice returns a slice view of the ID (shares memory, use carefully).
func (EventRef) Pub ¶ added in v0.36.11
Pub returns the pubkey (copy, stays on stack).
func (EventRef) PubHex ¶ added in v0.36.11
PubHex returns the pubkey as lowercase hex.
func (*EventRef) PubSlice ¶ added in v0.36.11
PubSlice returns a slice view of the pubkey (shares memory, use carefully).
func (EventRef) Ser ¶ added in v0.36.11
Ser returns the serial number.
func (EventRef) ToIdPkTs ¶ added in v0.36.11
ToIdPkTs converts EventRef to IdPkTs for backward compatibility. Note: This allocates new slices.
type Exporter ¶
type GetIdsWriter ¶
type I ¶
type I interface {
Pather
io.Closer
Pather
Wiper
Querier
Querent
Deleter
Saver
Importer
Exporter
Syncer
LogLeveler
EventIdSerialer
Initer
SerialByIder
}
I am a type for a persistence layer for nostr events handled by a relay.
type IdPkTs ¶
IdPkTs holds event reference data with slice fields for backward compatibility. For new code preferring stack-allocated, copy-on-assignment semantics, use the IDFixed() and PubFixed() methods or convert to EventRef.
func (*IdPkTs) IDFixed ¶ added in v0.36.11
IDFixed returns the event ID as a fixed-size array (stack-allocated, copied on assignment).
func (*IdPkTs) IDHex ¶ added in v0.36.11
IDHex returns the event ID as a lowercase hex string.
func (*IdPkTs) PubFixed ¶ added in v0.36.11
PubFixed returns the pubkey as a fixed-size array (stack-allocated, copied on assignment).
func (*IdPkTs) PubHex ¶ added in v0.36.11
PubHex returns the pubkey as a lowercase hex string.
type Importer ¶
type OK ¶
type OK = okenvelope.T
type Pather ¶
type Pather interface {
// Path returns the directory of the database.
Path() (s string)
}
type Querent ¶
type Querier ¶
type Rescanner ¶
type Rescanner interface {
// Rescan triggers the regeneration of indexes of the database to enable old
// records to be found with new indexes.
Rescan() (err error)
}
type Responder ¶
type Responder = http.ResponseWriter
type Saver ¶
type SerialByIder ¶
Source Files
¶
- alias.go
- errors.go
- store_interface.go