edgedb

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: Unlicense Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooManyIDs       = errors.New("too many ids")
	ErrTooManyAuthors   = errors.New("too many authors")
	ErrTooManyKinds     = errors.New("too many kinds")
	ErrEmptyTagSet      = errors.New("empty tag set")
	ErrTooManyTagValues = errors.New("too many tag values")
)

Functions

func EdgeDBEventToNostrEvent

func EdgeDBEventToNostrEvent(event Event) (*nostr.Event, error)

EdgeDBEventToNostrEvent converts the event from the edgedb.Event datatype to nostr.Event

Types

type EdgeDBBackend

type EdgeDBBackend struct {
	sync.Mutex
	*edgedb.Client
	DatabaseURI       string
	TLSSkipVerify     bool
	QueryIDsLimit     int
	QueryAuthorsLimit int
	QueryKindsLimit   int
	QueryTagsLimit    int
	QueryLimit        int
}

func (*EdgeDBBackend) Close

func (b *EdgeDBBackend) Close()

Close implements the Close method of the eventstore.Store interface

func (*EdgeDBBackend) DeleteEvent

func (b *EdgeDBBackend) DeleteEvent(ctx context.Context, event *nostr.Event) error

DeleteEvent implements the method of the eventstore.Store interface

func (*EdgeDBBackend) Init

func (b *EdgeDBBackend) Init() error

Init implements the Init method of the eventstore.Store inteface. It establishes the connection with Edgedb

func (*EdgeDBBackend) QueryEvents

func (b *EdgeDBBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)

QueryEvents is an implementation of the QueryEvents method of the eventstore.Store interfac for edgedb

func (*EdgeDBBackend) ReplaceEvent added in v0.15.0

func (b *EdgeDBBackend) ReplaceEvent(ctx context.Context, evt *nostr.Event) error

func (*EdgeDBBackend) SaveEvent

func (b *EdgeDBBackend) SaveEvent(ctx context.Context, event *nostr.Event) error

type Event

type Event struct {
	ID        edgedb.UUID             `edgedb:"id"`
	EventID   string                  `edgedb:"eventId"`
	Pubkey    string                  `edgedb:"pubkey"`
	CreatedAt edgedb.OptionalDateTime `edgedb:"createdAt"`
	Kind      int64                   `edgedb:"kind"`
	Tags      [][]byte                `edgedb:"tags"`
	Content   edgedb.OptionalStr      `edgedb:"content"`
	Sig       string                  `edgedb:"sig"`
}

func NostrEventToEdgeDBEvent

func NostrEventToEdgeDBEvent(event *nostr.Event) (Event, error)

NostrEventToEdgeDBEvent converts the event from the nostr.Event datatype to edgedb.Event

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL