server

package
v0.0.0-...-05cdca5 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 15 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 {
	GRPCAddr string `json:"grpc_address"` // gRPC server address
	Dsn      string `json:"database_dsn"` // data source name
	Config   string `json:"-"`            // config file path
	Debug    bool   `json:"-"`            // is debug mode
	TokenKey string `json:"token_key"`    // token key
}

Config - server config

func NewConfig

func NewConfig() *Config

NewConfig - create new config

func (*Config) UseFlags

func (cfg *Config) UseFlags()

UseFlags - use flags

func (*Config) UseJsonConfigFile

func (cfg *Config) UseJsonConfigFile() (*Config, error)

UseJsonConfigFile - use config file

type ServerApp

type ServerApp struct {
	GRPCServer *grpc.Server
	// contains filtered or unexported fields
}

ServerApp - server application

func NewServerApp

func NewServerApp(
	cfg Config,
	appMigrator migrate.IAppMigrator,
) *ServerApp

NewServerApp - constructor

func (*ServerApp) Run

func (s *ServerApp) Run() error

Run - run server

func (*ServerApp) Stop

func (s *ServerApp) Stop() error

Stop - stop server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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