server

package
v2.166.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Limiter *limiter.Config `yaml:"limiter,omitempty" json:"limiter,omitempty" toml:"limiter,omitempty"`
	Retry   *retry.Config   `yaml:"retry,omitempty" json:"retry,omitempty" toml:"retry,omitempty"`
	TLS     *tls.Config     `yaml:"tls,omitempty" json:"tls,omitempty" toml:"tls,omitempty"`
	Token   *token.Config   `yaml:"token,omitempty" json:"token,omitempty" toml:"token,omitempty"`
	Timeout string          `yaml:"timeout,omitempty" json:"timeout,omitempty" toml:"timeout,omitempty"`
	Address string          `yaml:"address,omitempty" json:"address,omitempty" toml:"address,omitempty"`
}

Config for server.

func (*Config) IsEnabled added in v2.115.0

func (c *Config) IsEnabled() bool

IsEnabled for server.

type Server

type Server interface {
	fmt.Stringer

	// Serve the underlying server.
	Serve() error

	// Shutdown the underlying server.
	Shutdown(ctx context.Context) error
}

Server allows transports to create their own.

type Service

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

Service handles the starting and stopping of a server.

func NewService

func NewService(name string, server Server, logger *logger.Logger, sh di.Shutdowner) *Service

NewService that can start and stop an underlying server.

func (*Service) Start

func (s *Service) Start()

Start the server.

func (*Service) Stop

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

Stop the server.

Jump to

Keyboard shortcuts

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