relay

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Unlicense Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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