Documentation ¶
Index ¶
- func Decrypt(data []byte, key []byte) ([]byte, error)
- func Encrypt(data []byte, key []byte) ([]byte, error)
- func ParseEvent(obj map[string]any) (*nostr.Event, error)
- func PrintKeyList(keys []*KeyInfo)
- func Scanline() string
- func SerializeKeys(l []string) []string
- func Serve(ctx context.Context, conn *Connection, ch chan<- *ConnectRequest, ...)
- func UpdateRelays(ctx context.Context, key *KeyInfo, boots []string, w *sync.WaitGroup)
- type AppMeta
- type ConnMetadata
- type ConnectRequest
- type Connection
- type DB
- func (d *DB) Close() error
- func (d *DB) Disconnect(id string) error
- func (d *DB) GetKey(pub string, pass []byte) (*KeyInfo, error)
- func (d *DB) Has(key string) bool
- func (d *DB) List() (keys []*KeyInfo, err error)
- func (d *DB) ListConnection() (list []*Connection, err error)
- func (d *DB) Remove(key []byte) (err error)
- func (d *DB) SaveEvent(bucket []byte, event *nostr.Event) error
- func (d *DB) SaveKey(pub string, priv []byte) error
- func (d *DB) SaveMetadata(key []byte, metadata string) error
- func (d *DB) SaveRelays(key []byte, relays []string) error
- func (d *DB) SetConnection(c *Connection) error
- type KeyInfo
- type KeyMetadata
- type NostrConnectInfo
- type RelayAttr
- type RelayMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseEvent ¶
func PrintKeyList ¶
func PrintKeyList(keys []*KeyInfo)
func SerializeKeys ¶
func Serve ¶
func Serve(ctx context.Context, conn *Connection, ch chan<- *ConnectRequest, wg *sync.WaitGroup)
Types ¶
type ConnMetadata ¶
type ConnectRequest ¶
type ConnectRequest struct { Method string `json:"method"` ID string `json:"id"` Params []any `json:"params"` Conn *Connection // contains filtered or unexported fields }
func (*ConnectRequest) CheckAllow ¶
func (cr *ConnectRequest) CheckAllow(name string) error
func (*ConnectRequest) Response ¶
func (cr *ConnectRequest) Response(data any) error
type Connection ¶
type DB ¶
func (*DB) Disconnect ¶
func (*DB) ListConnection ¶
func (d *DB) ListConnection() (list []*Connection, err error)
func (*DB) SetConnection ¶
func (d *DB) SetConnection(c *Connection) error
type KeyInfo ¶
type KeyInfo struct { Pubkey string Privkey string Metadata *KeyMetadata Relays RelayMap }
type KeyMetadata ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.