server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(New),
)

Module exported for initialising a new Server.

Functions

This section is empty.

Types

type Error

type Error struct {
	Error string `json:"error"`
}

Error defines the structure for a failed response.

type Server

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

Server is the main HTTP server.

func New

func New(cfg *config.Config, spoty *spoty.Spoty) *Server

New creates a new Server.

func (*Server) RegisterRoutes added in v0.2.0

func (s *Server) RegisterRoutes()

RegisterRoutes registers the REST HTTP routes.

func (*Server) Start

func (s *Server) Start() error

Start starts the server. It blocks until the server stops.

func (*Server) Stop

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

Stop stops the server.

type Success

type Success struct {
	Success string `json:"success"`
}

Success defines the structure for a successful response.

Jump to

Keyboard shortcuts

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