server

package
v0.0.0-...-cdef871 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDBNotInitialized = errors.New(
	"Database is not initialized. Run 'xbusd init'",
)

ErrDBNotInitialized is when the database was never initialized

View Source
var ErrDBNotVersionned = errors.New(
	"database is not versioned. " +
		"Apply manually the migration scripts up to version 3.0.0-beta.14, " +
		"then run 'xbusd migrate'")

ErrDBNotVersionned is returned by checkDBVersion if the database contains some tables but is not versionned, which means it was created before version 3.0.0-beta.14

Functions

This section is empty.

Types

type ErrDBNeedUpgrade

type ErrDBNeedUpgrade struct {
	CurrentVersion  uint
	RequiredVersion uint
}

ErrDBNeedUpgrade is returned if the database is not up-to-date with the server version

func (ErrDBNeedUpgrade) Error

func (e ErrDBNeedUpgrade) Error() string

Error returns the formatted error message

type InstanceProperties

type InstanceProperties struct {
	Name       string
	Production bool
}

InstanceProperties contains the description of a xbus instance

type Options

type Options struct {
	Instance                       InstanceProperties
	DatabaseDSN                    string
	DatabaseLogFlags               qb.LogFlags
	DatabaseMaxConnections         int
	ProcessStorageDBMaxConnections int
	RootCA                         string // a PEM or a path to a PEM file
	ServerCert                     string // a PEM or a path to a PEM file
	ServerKey                      string // a PEM or a path to a PEM file
	ClientCA                       string // a PEM or a path to a PEM file
	ClientCAKey                    string // a PEM or a path to a PEM file
	TLSTimeout                     float64
	NATSHost                       string
	NATSPort                       int
	NATSDebug                      bool
	NATSTrace                      bool
	StorageEnvelopeCache           bool
	StorageEnvelopeCacheMaxSize    int64
	StorageEnvelopeImpl            string
	StorageEnvelopeFallback        string
	ServeNATS                      bool
	ServeBroker                    bool
	ServeClientAPI                 bool
	ServeDirector                  bool
	ServeEnvelopeStorage           bool
	ServeControl                   bool
	ServeMetrics                   bool
	ServePostmortem                bool
	ServeProcessState              bool
	ServeRegistration              bool
	ServeSentinel                  bool
	GnatsdOptions                  gnatsd.Options
	Sentry                         *sentry.Hub
	Logger                         xbus.ZeroLogger
	MetricsHTTPHost                string
	MetricsHTTPPort                int
	MetricsMergeGlobal             bool
	MetricsDelayHint               time.Duration
	ServiceSentinel                sentinel.Settings
}

Options of a server

type Server

type Server struct {
	ServiceManager *services.Manager
	// contains filtered or unexported fields
}

Server the XBus server

func NewServer

func NewServer(options Options) (*Server, error)

NewServer creates a Server

func (*Server) AccountStorage

func (s *Server) AccountStorage() storage.AccountStorage

AccountStorage returns the underlying AccountStorage

func (*Server) ActorStorage

func (s *Server) ActorStorage() storage.ActorStorage

ActorStorage returns the underlying ActorStorage

func (*Server) CertNATSUrls

func (s *Server) CertNATSUrls() []string

CertNATSUrls returns the nats server url based on the certificate SANs

func (*Server) GetEnvelopeStorage

func (s *Server) GetEnvelopeStorage() storage.EnvelopeStorage

GetEnvelopeStorage returns the envelope storage

func (*Server) GetSentryHub

func (s *Server) GetSentryHub() *sentry.Hub

GetSentryHub returns the sentry.Hub instance

func (*Server) NATSConnectOptions

func (s *Server) NATSConnectOptions() nats.Options

NATSConnectOptions returns nats.Options to connect to the bus with full access

func (*Server) NATSUrl

func (s *Server) NATSUrl() string

NATSUrl returns the nats server url

func (*Server) PasswordStorage

func (s *Server) PasswordStorage() storage.PasswordStorage

PasswordStorage returns the underlying PasswordStorage

func (*Server) ProcessManager

func (s *Server) ProcessManager() *process.Manager

ProcessManager returns the process manager

func (*Server) ProcessStorage

func (s *Server) ProcessStorage() storage.ProcessStorage

ProcessStorage returns the underlying ProcessStorage

func (*Server) SetEnvelopeStorageDB

func (s *Server) SetEnvelopeStorageDB(m *model.Model, db *yago.DB)

SetEnvelopeStorageDB sets the model & db for the envelope storage

func (*Server) SetLogger

func (s *Server) SetLogger(logger xbus.ZeroLogger)

SetLogger changes the logger used by server

func (*Server) SetSQLDB

func (s *Server) SetSQLDB(m *model.Model, db *yago.DB)

SetSQLDB sets the model & db

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown stops the services and nats server (if relevant)

func (*Server) StartNATS

func (s *Server) StartNATS() error

StartNATS starts the nats server

func (*Server) Startup

func (s *Server) Startup() (err error)

Startup starts the server

func (*Server) StopNATS

func (s *Server) StopNATS()

StopNATS stops the nats server

Jump to

Keyboard shortcuts

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