http_server

package
v0.0.0-...-4935cf5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 91 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AttachmentDerivativeJPEGQuality keeps displayed attachment images compact
	// without changing the encoding quality of public server assets.
	AttachmentDerivativeJPEGQuality = 75
	// AttachmentStableCachePrefix is versioned whenever attachment derivative
	// encoding changes so older cached bytes cannot be reused.
	AttachmentStableCachePrefix = core.AttachmentDerivativeCacheResource
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

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

HTTPServer serves the HTTP APIs and static frontend.

func NewHTTPServer

func NewHTTPServer(cfg HTTPServerConfig) (*HTTPServer, error)

NewHTTPServer creates a new HTTP server with the provided dependencies.

func (*HTTPServer) Run

func (s *HTTPServer) Run(ctx context.Context) error

Run starts the HTTP server(s) and blocks until ctx is cancelled or an error occurs.

type HTTPServerConfig

type HTTPServerConfig struct {
	Config  config.ChattoConfig
	NC      *nats.Conn
	Core    *core.ChattoCore
	Addr    string
	Version string
	// StartupStartedAt includes core boot in the readiness duration. Zero uses
	// the time Run starts. Optional runtime units do not gate HTTP readiness.
	StartupStartedAt time.Time
	// MetricsCollectors are process-local collectors that the metrics
	// listener serves in addition to the Chatto metrics, for example the
	// health metrics of the embedded search provider.
	MetricsCollectors []prometheus.Collector
}

HTTPServerConfig holds configuration for creating an HTTPServer.

type OAuthClient

type OAuthClient struct {
	ClientID     string
	ClientName   string
	ClientURI    string
	RedirectURIs []string
	// Native permits the RFC 8252 variable-port exception for literal
	// loopback IP callbacks. Web clients always require an exact callback.
	Native bool
	// AnyLoopbackOrigin permits each registered callback on every HTTP or HTTPS
	// loopback origin, with any port. The path and query must stay exact. Only
	// the built-in loopback client sets it.
	AnyLoopbackOrigin bool
	BuiltIn           bool
}

OAuthClient is the validated identity and redirect contract for one public OAuth client. Metadata is informational; ClientID, RedirectURIs, and Native are the security-sensitive fields.

type OAuthClientResolver

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

OAuthClientResolver safely retrieves public-client metadata from CIMD Client Identifier URLs. Valid documents are cached briefly according to their response headers.

func (*OAuthClientResolver) Resolve

func (r *OAuthClientResolver) Resolve(ctx context.Context, clientID string) (OAuthClient, error)

type OpenGraphMeta

type OpenGraphMeta struct {
	Title        string
	Description  string
	Image        string
	URL          string
	Type         string // "website" for all pages
	SiteName     string
	CanonicalURL string // set when the content lives on a different instance
}

OpenGraphMeta holds metadata for OpenGraph tags.

Jump to

Keyboard shortcuts

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