relay

package
v0.3.32-nightly Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInterface

type ClientInterface interface {
	SendMessage(msg interface{})
	GetWS() *websocket.Conn
	GetSubscriptions() map[string][]Filter
	CloseClient()
}

ClientInterface abstracts WebSocket clients

type Event

type Event struct {
	ID        string     `json:"id" bson:"id"`
	PubKey    string     `json:"pubkey" bson:"pubkey"`
	CreatedAt int64      `json:"created_at" bson:"created_at"`
	Kind      int        `json:"kind" bson:"kind"`
	Tags      [][]string `json:"tags" bson:"tags"`
	Content   string     `json:"content" bson:"content"`
	Sig       string     `json:"sig" bson:"sig"`
}

type Filter

type Filter struct {
	IDs     []string            `json:"ids"`
	Authors []string            `json:"authors"`
	Kinds   []int               `json:"kinds"`
	Tags    map[string][]string `json:"tags"`
	Since   *time.Time          `json:"since"`
	Until   *time.Time          `json:"until"`
	Limit   *int                `json:"limit"`
}

Filter represents the criteria used to query events

type Subscription

type Subscription struct {
	ID      string
	Filters []Filter
}

Jump to

Keyboard shortcuts

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