qwkapi

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Authenticate(handle, password string) (*user.User, bool)
}

Authenticator verifies BBS credentials (satisfied by *user.UserMgr).

type Deps

type Deps struct {
	Config       config.QWKAPIConfig
	ConfigDir    string // where auto TLS certs live
	Users        Authenticator
	Service      PacketService
	AuthorizeFor func(u *user.User) func(area *message.MessageArea) bool
}

Deps are the collaborators the API server needs.

type PacketService

type PacketService interface {
	BuildPacket(opts qwkservice.ExportOptions) (*qwkservice.ExportResult, error)
	CommitExport(handle string, res *qwkservice.ExportResult)
	ImportREP(data []byte, opts qwkservice.ImportOptions) (*qwkservice.ImportResult, error)
}

PacketService is the subset of *qwkservice.Service the API needs.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the QWK packet transport API.

func NewServer

func NewServer(deps Deps) (*Server, error)

NewServer builds the server and resolves its TLS certificate.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler builds the routed, middleware-wrapped handler.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully stops the server and its sweeper.

func (*Server) Start

func (s *Server) Start() error

Start serves HTTPS until Shutdown is called; blocking.

Jump to

Keyboard shortcuts

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