app

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelpRequested

func HelpRequested() (help bool)

func NewConfig

func NewConfig() (cfg *Config, err E)

Types

type B

type B = []byte

type Config

type Config struct {
	AppName  string `env:"APP_NAME" default:"realy"`
	Root     string `env:"ROOT_DIR" usage:"root path for all other path configurations (defaults OS user home if empty)"`
	Profile  string `env:"PROFILE" default:".realy" usage:"name of directory in root path to store relay state data and database"`
	Listen   string `env:"LISTEN" default:"0.0.0.0" usage:"network listen address"`
	Port     int    `env:"PORT" default:"3334" usage:"port to listen on"`
	LogLevel string `env:"LOGLEVEL" default:"info" usage:"debug level: fatal error warn info debug trace"`
}

type Ctx

type Ctx = context.T

type E

type E = error

type N

type N = int

type Relay

type Relay struct {
	*Config
	Store store.I
}

func (*Relay) AcceptEvent

func (r *Relay) AcceptEvent(c context.T, evt *event.T) bool

func (*Relay) AcceptReq

func (r *Relay) AcceptReq(c Ctx, id B, ff *filters.T, authedPubkey B) bool

func (*Relay) Init

func (r *Relay) Init() E

func (*Relay) Name

func (r *Relay) Name() S

func (*Relay) ServiceUrl

func (r *Relay) ServiceUrl(req *http.Request) (s S)

ServiceUrl returns the address of the relay to send back in auth responses. If this is implemented it enables auth-required.

func (*Relay) Storage

func (r *Relay) Storage(c context.T) store.I

type S

type S = string

func PrintHelp

func PrintHelp(cfg *Config, printer io.Writer) (s S)

Jump to

Keyboard shortcuts

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