system

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module interface {
	Startup(context.Context, Service) error
}

type Service

type Service interface {
	Config() config.AppConfig
	SqlDB() *sql.DB
	MongoDB() *mongo.Client
	JS() nats.JetStreamContext
	Mux() *chi.Mux
	RPC() *grpc.Server
	Waiter() waiter.Waiter
	Logger() zerolog.Logger
}

type System

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

func NewSystem

func NewSystem(cfg config.AppConfig) (*System, error)

func (*System) Config

func (s *System) Config() config.AppConfig

func (*System) JS

func (s *System) JS() nats.JetStreamContext

func (*System) Logger

func (s *System) Logger() zerolog.Logger

func (*System) MigrateDB

func (s *System) MigrateDB(fs fs.FS) error

func (*System) MongoDB added in v0.1.3

func (s *System) MongoDB() *mongo.Client

MongoDB returns a pointer to the mongo.Client instance associated with the System. This method provides access to the MongoDB client, allowing for operations such as querying and manipulating documents within MongoDB collections. Similar to DB(), it is crucial to ensure that the System has been appropriately initialized and connected to a MongoDB instance before invoking this method.

func (*System) Mux

func (s *System) Mux() *chi.Mux

func (*System) RPC

func (s *System) RPC() *grpc.Server

func (*System) SqlDB added in v0.1.3

func (s *System) SqlDB() *sql.DB

SqlDB returns a pointer to the sql.DB instance associated with the System. This method provides access to the SQL database client, which can be used for executing SQL queries and operations. It is important to ensure that the System instance has been properly initialized and connected to the database before calling this method.

func (*System) WaitForRPC

func (s *System) WaitForRPC(ctx context.Context) error

func (*System) WaitForStream

func (s *System) WaitForStream(ctx context.Context) error

func (*System) WaitForWeb

func (s *System) WaitForWeb(ctx context.Context) error

func (*System) Waiter

func (s *System) Waiter() waiter.Waiter

Jump to

Keyboard shortcuts

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