server

package
v0.0.0-...-edd07d6 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Development bool

	Host string `envDefault:"localhost"`
	Port int    `envDefault:"8125"`

	ReadTimeout     time.Duration `envDefault:"10s"`
	ShutdownTimeout time.Duration `envDefault:"10s"`
	WriteTimeout    time.Duration `envDefault:"10s"`

	Database db.Config     `envPrefix:"DATABASE_"`
	Sender   worker.Config `envPrefix:"SENDER_"`
	SMTP     smtp.Config   `envPrefix:"SMTP_"`
}

func ParseConfig

func ParseConfig() (Config, error)

func (Config) ServerAddress

func (c Config) ServerAddress() string

func (Config) String

func (c Config) String() string

func (Config) Validate

func (c Config) Validate() error

type Server

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

func NewServer

func NewServer(cfg Config) Server

func (Server) Routes

func (s Server) Routes(repo db.Repository)

func (Server) Start

func (s Server) Start()

Jump to

Keyboard shortcuts

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