server

package
v0.0.0-...-0f17f66 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseServer

func CloseServer(ctx context.Context) error

Types

type Application

type Application struct {
	WebApp     *iris.Application
	Middleware []context.Handler

	Database struct {
		Debug bool

		Install func() (db interface{})
		// contains filtered or unexported fields
	}

	Cache struct {
		Debug bool

		Install func() (client redis.Cmdable)
		// contains filtered or unexported fields
	}
}

func NewApp

func NewApp() *Application

NewApp .

func (*Application) CreateRunner

func (m *Application) CreateRunner(addr string, configurators ...host.Configurator) iris.Runner

func (*Application) InstallDB

func (m *Application) InstallDB(debug bool, f func() interface{})

func (*Application) InstallMiddleware

func (m *Application) InstallMiddleware(handler iris.Handler)

func (*Application) InstallRedis

func (m *Application) InstallRedis(debug bool, f func() (client redis.Cmdable))

func (*Application) Logger

func (m *Application) Logger() *golog.Logger

Logger .

func (*Application) Run

func (app *Application) Run(serve iris.Runner, irisConf iris.Configuration)

func (*Application) RunDb

func (m *Application) RunDb()

func (*Application) RunMiddleware

func (m *Application) RunMiddleware()

type Server

type Server struct {
	Name            string
	Conf            *config.ServerConfig
	MasterServer    processor.Processor
	SentinelServers map[string]processor.Processor
	StatLog         string
	RunStatus       bool
}

func (*Server) AwaitSignal

func (m *Server) AwaitSignal(ctx context.Context)

func (*Server) Close

func (m *Server) Close(ctx context.Context, conf *config.ServerConfig) error

func (*Server) GetConfig

func (m *Server) GetConfig(ctx context.Context) (*config.ServerConfig, error)

func (*Server) GetDriver

func (m *Server) GetDriver(ctx context.Context) interface{}

func (*Server) Init

func (m *Server) Init(ctx context.Context, conf *config.ServerConfig) (interface{}, error)

func (*Server) Start

func (m *Server) Start(ctx context.Context, conf1 *config.ServerConfig) error

Jump to

Keyboard shortcuts

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