relay

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Unlicense Imports: 3 Imported by: 0

Documentation

Overview

Package relay contains a collection of server for enabling the building of modular nostr relay implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type I

type I interface {
	// Name is used as the "name" field in NIP-11 and as a prefix in default
	// S logging. For other NIP-11 fields, see [Informer].
	Name() string
	// Init is called at the very beginning by [S.Start], allowing a realy
	// to initialize its internal resources.
	Init() error
	// Storage returns the relay storage implementation.
	Storage() store.I
}

I is the main interface for implementing a nostr relay.

type Informer

type Informer interface {
	GetNIP11InformationDocument() *relayinfo.T
}

Informer is called to compose NIP-11 response to an HTTP request with application/nostr+json mime type. See also [I.Name].

type Logger

type Logger interface {
	Infof(format string, v ...any)
	Warningf(format string, v ...any)
	Errorf(format string, v ...any)
}

Logger is what [S] uses to log messages.

type ShutdownAware

type ShutdownAware interface {
	OnShutdown(context.T)
}

ShutdownAware is called during the server shutdown. See [S.Shutdown] for details.

Jump to

Keyboard shortcuts

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