api

package
v0.0.0-...-2a7283e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(options ...Option) error

NewRouter creates a new router with the given options

Types

type Option

type Option func(*RouterConfig)

Option defines a function that configures a Router

func WithAuth

func WithAuth(auth *authz.Service) Option

WithAuth sets the auth for the router

func WithContext

func WithContext(ctx *cli.Context) Option

WithContext sets the context for the server

func WithDatastore

func WithDatastore(store datastore.Datastore) Option

WithDatastore sets the datastore for the router

func WithPort

func WithPort(port int) Option

WithPort sets the port for the server

func WithRateLimit

func WithRateLimit(limiter *ratelimit.RateLimit) Option

WithRateLimit sets the rate limiter for the router

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

WithShutdownTimeout sets the graceful shutdown timeout

type RouterConfig

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

RouterConfig holds all router configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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