server

package
v0.0.0-...-3133c99 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 9 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 {
	Address string `yaml:"address"`
	Port    int    `yaml:"port" validate:"required"`
}

Config contains configuration options for the Server.

type Dependencies

type Dependencies struct {
	UsersRepo usersRepo `validate:"required"`
}

Config contains all dependencies needed by business logic.

type Server

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

Server implements application HTTP server. Business logic is implemented in server endpoint functions.

func New

func New(c Config, d Dependencies) (*Server, error)

New creates new HTTP server for the microservice.

func (*Server) Serve

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

Serve starts serving endpoints. Handles graceful shutdown.

Blocking.

Jump to

Keyboard shortcuts

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