server

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(name string, config *config.Config)

func StartAll

func StartAll(config *config.Config)

Types

type AbstractServer

type AbstractServer interface {
	BeforeRun(*config.Config) micro.Service
	Run(*config.Config) error
	GetName() string
	GetServiceName() string
	ServiceClient() interface{}
	RegisterServiceHandlerFunc() error
	GetWebRouter() router.AbstractRouter
	ErrGroup() *errgroup.Group
	EtcdReg(*config.EtcdOptions) registry.Registry
}

type Manager

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

func Init

func Init() *Manager

func (*Manager) Client

func (sm *Manager) Client(serverName string) interface{}

func (*Manager) Clients

func (sm *Manager) Clients() []interface{}

func (*Manager) Init

func (sm *Manager) Init() *Manager

func (*Manager) Register

func (sm *Manager) Register(servers ...AbstractServer) *Manager

func (*Manager) Routers

func (sm *Manager) Routers() []router.AbstractRouter

func (*Manager) Run

func (sm *Manager) Run(name string, config *config.Config) error

func (*Manager) RunAll

func (sm *Manager) RunAll(config *config.Config)

type Server

type Server struct {
	AbstractServer
	G                     *errgroup.Group
	ServiceCallFunc       func(microService micro.Service)
	AfterRun              func(error, interface{})
	Config                *config.Config
	Name                  string
	ServiceName           string
	ClientService         micro.Service
	Service               interface{}
	WebRouter             router.AbstractRouter
	AutoAutoMigrateTables []interface{}
}

func (*Server) BeforeRun

func (s *Server) BeforeRun(config *config.Config) micro.Service

func (*Server) ErrGroup

func (s *Server) ErrGroup() *errgroup.Group

func (*Server) EtcdReg

func (s *Server) EtcdReg(options *config.EtcdOptions) registry.Registry

func (*Server) GetConfig

func (s *Server) GetConfig() *config.Config

func (*Server) GetName

func (s *Server) GetName() string

func (*Server) GetServiceName

func (s *Server) GetServiceName() string

func (*Server) GetWebRouter

func (s *Server) GetWebRouter() router.AbstractRouter

func (*Server) Run

func (s *Server) Run(config *config.Config) error

func (*Server) ServiceClient

func (s *Server) ServiceClient() interface{}

Jump to

Keyboard shortcuts

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