servers

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package servers implements the components required for the servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommunityServerInitializer

func NewCommunityServerInitializer(displayName string, serviceKinds []services.ServiceKind) (servers.ServerInitializer, error)

NewCommunityServerInitializer creates a new community server initializer.

Types

type CommunityServerInitializer

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

CommunityServerInitializer is the community service factory initializer.

func (*CommunityServerInitializer) HasCentralStorage

func (c *CommunityServerInitializer) HasCentralStorage() bool

HasCentralStorage returns true if a central storage is required.

func (*CommunityServerInitializer) HostInfo added in v0.0.7

HostInfo returns the infos of the service kind set as host.

func (*CommunityServerInitializer) Services added in v0.0.7

Services returns the active service kinds.

func (*CommunityServerInitializer) ServicesFactories added in v0.0.7

ServicesFactories returns the service factories providers.

func (*CommunityServerInitializer) Storages added in v0.0.7

func (c *CommunityServerInitializer) Storages(centralStorageEngine storage.Kind) []storage.Kind

Storages returns the active storage kinds.

func (*CommunityServerInitializer) StoragesFactories added in v0.0.7

func (c *CommunityServerInitializer) StoragesFactories(centralStorageEngine storage.Kind) (map[storage.Kind]storage.FactoryProvider, error)

StoragesFactories returns the storage factories providers.

type Server

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

Server represents the applicative server.

func (*Server) DisplayName added in v0.0.20

func (s *Server) DisplayName() string

DisplayName returns the display name.

func (*Server) HasDebug

func (s *Server) HasDebug() bool

HasDebug returns true if debug is enabled.

func (*Server) Logger added in v0.0.7

func (s *Server) Logger() *zap.Logger

Logger returns the logger.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, onShutdown func()) (bool, error)

Serve runs the server and then calls the onshutdown function.

func (*Server) Shutdown

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

Shutdown signals the server to shutdown.

type ServerConfig

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

ServerConfig holds the configuration for the server.

func (*ServerConfig) AddFlags

func (c *ServerConfig) AddFlags(flagSet *flag.FlagSet) error

AddFlags adds flags.

func (*ServerConfig) AppData added in v0.0.7

func (c *ServerConfig) AppData() string

AppData returns the zone data.

func (*ServerConfig) CentralStorageEngine added in v0.0.7

func (c *ServerConfig) CentralStorageEngine() storage.Kind

CentralStorageEngine returns the central storage engine.

func (*ServerConfig) DisplayName added in v0.0.20

func (c *ServerConfig) DisplayName() string

DisplayName returns the display name.

func (*ServerConfig) InitFromViper

func (c *ServerConfig) InitFromViper(v *viper.Viper) error

InitFromViper initializes the configuration from viper.

func (*ServerConfig) Services added in v0.0.7

func (c *ServerConfig) Services() []services.ServiceKind

Services returns service kinds.

func (*ServerConfig) ServicesFactories added in v0.0.7

ServicesFactories returns factories.

func (*ServerConfig) Storages added in v0.0.7

func (c *ServerConfig) Storages() []storage.Kind

Storages returns service kinds.

func (*ServerConfig) StoragesFactories added in v0.0.7

func (c *ServerConfig) StoragesFactories() map[storage.Kind]storage.FactoryProvider

StoragesFactories returns factories.

type ServerFactory

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

ServerFactory is the configuration for the server factory.

func NewServerFactory

func NewServerFactory(serverCfg *ServerFactoryConfig) (*ServerFactory, error)

NewServerFactory creates the server factory.

func (*ServerFactory) CreateServer

func (f *ServerFactory) CreateServer() (*Server, error)

CreateServer creates a new server.

type ServerFactoryConfig

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

ServerFactoryConfig holds the configuration for the server factory.

func NewServerFactoryConfig

func NewServerFactoryConfig(initializer servers.ServerInitializer, centralStorageEngine storage.Kind) (*ServerFactoryConfig, error)

NewServerFactoryConfig creates a new server factory configuration.

func (*ServerFactoryConfig) AddFlags

func (c *ServerFactoryConfig) AddFlags(flagSet *flag.FlagSet) error

AddFlags adds flags.

func (*ServerFactoryConfig) InitFromViper

func (c *ServerFactoryConfig) InitFromViper(v *viper.Viper) error

InitFromViper initializes the configuration from viper.

Jump to

Keyboard shortcuts

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