server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package server contains the HTTP, gRPC and CoAP server implementation.

Copyright (c) Ultraviolet SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StopHandler

func StopHandler(ctx context.Context, cancel context.CancelFunc, logger *slog.Logger, svcName string, servers ...Server) error

Types

type BaseServer

type BaseServer struct {
	Ctx      context.Context
	Cancel   context.CancelFunc
	Name     string
	Address  string
	Config   Config
	Logger   *slog.Logger
	Protocol string
}

type Config

type Config struct {
	Host         string `env:"HOST"               envDefault:""`
	Port         string `env:"PORT"               envDefault:""`
	CertFile     string `env:"SERVER_CERT"        envDefault:""`
	KeyFile      string `env:"SERVER_KEY"         envDefault:""`
	ServerCAFile string `env:"SERVER_CA_CERTS"    envDefault:""`
	ClientCAFile string `env:"CLIENT_CA_CERTS"    envDefault:""`
	AttestedTLS  bool   `env:"ATTESTED_TLS"       envDefault:"false"`
}

type Server

type Server interface {
	Start() error
	Stop() error
}

Directories

Path Synopsis
Package grpc contains the gRPC server implementation.
Package grpc contains the gRPC server implementation.

Jump to

Keyboard shortcuts

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