api

package
v0.0.0-...-5485e49 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Echo *echo.Echo
	// contains filtered or unexported fields
}

Server implementation of the Server's API operations.

func New

func New(
	appConfig config.Config,
	logger *slog.Logger,
) *Server

New initialize a new Server and configure an Echo server.

func (*Server) CreateHandlers

func (s *Server) CreateHandlers(
	appFs afero.Fs,
	clientManager client.Manager,
) []func(e *echo.Echo)

CreateHandlers initializes handlers and returns a slice of functions to register them.

func (*Server) GetNetworkHandler

func (s *Server) GetNetworkHandler(
	_ afero.Fs,
	clientManager client.Manager,
) []func(e *echo.Echo)

GetNetworkHandler returns network handler for registration.

func (*Server) GetSystemHandler

func (s *Server) GetSystemHandler() []func(e *echo.Echo)

GetSystemHandler returns system handler for registration.

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers(handlers []func(e *echo.Echo))

RegisterHandlers registers a list of handlers with the Echo instance.

func (*Server) Start

func (s *Server) Start()

Start starts the Echo server with the configured port.

func (*Server) Stop

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

Stop gracefully shuts down the Echo server.

type ServerManager

type ServerManager interface {
	// Start starts the Echo server with the configured port.
	Start()
	// Stop gracefully shuts down the Echo server.
	Stop(ctx context.Context)
	// CreateHandlers initializes handlers and returns a slice of functions to register them.
	CreateHandlers(
		appFs afero.Fs,
		clientManager client.Manager,
	) []func(e *echo.Echo)
	// RegisterHandlers registers a list of handlers with the Echo instance.
	RegisterHandlers(handlers []func(e *echo.Echo))
}

ServerManager responsible for Server operations.

Directories

Path Synopsis
common
gen
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.
gen
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.
gen
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.
gen
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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