servers

package
v0.0.0-...-187538d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 20 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(host azservices.HostKind) (azservers.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) GetHost

GetHost returns the service kind set as host.

func (*CommunityServerInitializer) GetHostInfo

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

func (*CommunityServerInitializer) GetServices

GetServices returns the active service kinds.

func (*CommunityServerInitializer) GetServicesFactories

GetServicesFactories returns the service factories providers.

func (*CommunityServerInitializer) GetStorages

func (c *CommunityServerInitializer) GetStorages(centralStorageEngine azstorage.StorageKind, proximityStorageEngine azstorage.StorageKind) []azstorage.StorageKind

GetStorages returns the active storage kinds.

func (*CommunityServerInitializer) GetStoragesFactories

func (c *CommunityServerInitializer) GetStoragesFactories(centralStorageEngine azstorage.StorageKind, proximityStorageEngine azstorage.StorageKind) (map[azstorage.StorageKind]azstorage.StorageFactoryProvider, error)

GetStoragesFactories returns the storage factories providers.

func (*CommunityServerInitializer) HasCentralStorage

func (c *CommunityServerInitializer) HasCentralStorage() bool

HasCentralStorage returns true if a central storage is required.

func (*CommunityServerInitializer) HasProximityStorage

func (c *CommunityServerInitializer) HasProximityStorage() bool

HasProximityStorage returns true if a proximity storage is required.

type Server

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

Server represents the applicative server.

func (*Server) GetHost

func (s *Server) GetHost() azservices.HostKind

GetHost returns the hsot kind.

func (*Server) GetLogger

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

GetLogger returns the logger.

func (*Server) HasDebug

func (s *Server) HasDebug() bool

HasDebug returns true if debug is enabled.

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) GetAppData

func (c *ServerConfig) GetAppData() string

GetAppData returns the app data.

func (*ServerConfig) GetCentralStorageEngine

func (c *ServerConfig) GetCentralStorageEngine() azstorage.StorageKind

GetCentralStorageEngine returns the central storage engine.

func (*ServerConfig) GetHost

func (c *ServerConfig) GetHost() azservices.HostKind

GetHost returns the host kind.

func (*ServerConfig) GetProximityStorageEngine

func (c *ServerConfig) GetProximityStorageEngine() azstorage.StorageKind

GetProximityStorageEngine returns the proximity storage engine.

func (*ServerConfig) GetServices

func (c *ServerConfig) GetServices() []azservices.ServiceKind

GetServices returns service kinds.

func (*ServerConfig) GetServicesFactories

GetServicesFactories returns factories.

func (*ServerConfig) GetStorages

func (c *ServerConfig) GetStorages() []azstorage.StorageKind

GetStorages returns service kinds.

func (*ServerConfig) GetStoragesFactories

func (c *ServerConfig) GetStoragesFactories() map[azstorage.StorageKind]azstorage.StorageFactoryProvider

GetStoragesFactories returns factories.

func (*ServerConfig) InitFromViper

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

InitFromViper initializes the configuration from viper.

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 azservers.ServerInitializer, centralStorageEngine azstorage.StorageKind, proximityStorageEngine azstorage.StorageKind) (*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