rest

package
v0.0.0-...-cee63af Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

rest package is the application's REST API. It implements an HTTP server and handlers to process requests by calling the appropriate service for processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App implements the transport layer by running an HTTP server.

func NewApp

func NewApp(logger *slog.Logger, addr string, fooHdler, barHdler handler) (*App, error)

NewApp instantiates a new App struct.

func (*App) Run

func (app *App) Run() error

Run starts the application, serving on the specified address and port as provided in the configuration.

func (*App) Shutdown

func (app *App) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server. The shutdown timeout can be controlled by the context passed as an argument.

Directories

Path Synopsis
handlers
bar
foo

Jump to

Keyboard shortcuts

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