server

package
v0.0.0-...-cee6fe1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package server provides the HTTP server setup for socialapp

Index

Constants

View Source
const (
	DefaultMiddlewareTimeout = 20 * time.Second
	CompressionLevel         = 5
)

Configuration constants

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(ctx context.Context, config Config) (chi.Router, error)

NewRouter creates and configures the main chi router

Types

type Config

type Config struct {
	InstanceID            string
	AppName               string
	AppPort               int
	ProxyURL              string
	LogLevel              slog.Level
	LogDestinations       []io.Writer
	LoggerProvider        *sdklog.LoggerProvider
	DBPool                *pgxpool.Pool
	Queries               *dbpgx.Queries
	Cache                 *cache.Cache
	PropertiesSubdomain   *url.URL
	DefaultTimeout        time.Duration
	URLShortenerSubdomain string
	URLShortenerURL       *url.URL
	SocialappSubdomain    string
	JWTSecret             string
	PuttyknifeSubDomain   string
	PuttyknifeURL         *url.URL
	KibanaSubdomain       string
	KibanaURL             string
	LocalSubdomain        string
	OpenAPIContent        []byte
}

Config holds all the configuration for the server

Jump to

Keyboard shortcuts

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