server

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupRoutes

func SetupRoutes(instance *echo.Echo, handlers Handlers)

SetupRoutes assigns middlewares and handlers to the application routes

Types

type Configuration

type Configuration struct {
	App      *_app
	Database *_database
	NewRelic *_newRelic
	Sentry   *_sentry
}

Configuration stores all the settings for the application

func NewConfiguration

func NewConfiguration() (*Configuration, error)

NewConfiguration creates a new Configuration instance

type Dependencies

type Dependencies struct {
	Database *pgx.Conn
}

Dependencies describes de application internal services

func NewDependencies

func NewDependencies(configuration Configuration) (*Dependencies, error)

NewDependencies creates a new Dependencies instance

type Handlers

type Handlers struct {
	Cookie cookiehandler.Handler
}

Handlers describes the application handlers

func NewHandlers

func NewHandlers(dependencies Dependencies) (*Handlers, error)

NewHandlers creates a new Handlers instance

type Server

type Server struct {
	Instance      *echo.Echo
	Configuration *Configuration
	Dependencies  *Dependencies
	Handlers      *Handlers
	Services      *Services
}

Server describes the main application instance

func NewServer

func NewServer(e *echo.Echo) *Server

NewServer creates a new Server instance

func (*Server) Run

func (s *Server) Run()

Run starts the server

func (*Server) Shutdown

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

Shutdown stops the server

type Services

type Services struct {
	Sentry     *sentry.Client
	Prometheus *prometheus.Prometheus
	Jaeger     io.Closer
}

Services describes the application external services

func NewServices

func NewServices(instance *echo.Echo, configuration Configuration) (*Services, error)

NewServices creates a new Services instance

Jump to

Keyboard shortcuts

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