service

package
v1.6.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 4 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 {
	EnvName           string `env:"ENV_NAME"`
	ServerAddress     string `env:"SERVER_ADDRESS"`
	PrimaryDBHost     string `env:"DB_HOST"`
	PrimaryDBUser     string `env:"DB_USER"`
	PrimaryDBPassword string `env:"DB_PASSWORD"`
	PrimaryDBName     string `env:"DB_NAME"`
	PrimaryDBPort     string `env:"DB_PORT"`
	ReplicaDBHost     string `env:"DB_REPLICA_HOST"`
	ReplicaDBUser     string `env:"DB_REPLICA_USER"`
	ReplicaDBPassword string `env:"DB_REPLICA_PASSWORD"`
	ReplicaDBName     string `env:"DB_REPLICA_NAME"`
	ReplicaDBPort     string `env:"DB_REPLICA_PORT"`
	MongoDBHost       string `env:"MONGO_HOST"`
	MongoDBName       string `env:"MONGO_NAME"`
	MongoDBUser       string `env:"MONGO_USER"`
	MongoDBPassword   string `env:"MONGO_PASSWORD"`
	MongoDBPort       string `env:"MONGO_PORT"`
}

Config is the top level configuration struct for the entire application.

func NewConfig

func NewConfig() *Config

NewConfig creates an instance of Config.

type Server

type Server struct {
	mlog.Logger
	// contains filtered or unexported fields
}

Server represents the http server for Ledger service.

func NewServer

func NewServer(cfg *Config, app *fiber.App, logger mlog.Logger) *Server

NewServer creates an instance of Server.

func (*Server) Run

func (s *Server) Run(l *common.Launcher) error

Run runs the server.

func (*Server) ServerAddress

func (s *Server) ServerAddress() string

ServerAddress returns is a convenience method to return the server address.

type Service

type Service struct {
	*Server
	mlog.Logger
}

Service is the application glue where we put all top level components to be used.

func (*Service) Run

func (app *Service) Run()

Run starts the application. This is the only necessary code to run an app in main.go

Jump to

Keyboard shortcuts

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