module

package
v0.0.0-...-7372eca Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerNotAllowed = errors.New("grpc server is nil")
	ErrModuleExists     = errors.New("module has exists")
)

some default error

Functions

func Init

func Init(srv *grpc.Server, mux *runtime.ServeMux) (err error)

Init initialization module manager

Types

type IModule

type IModule interface {
	Init() error
	Name() string
	RegisterServer(*grpc.Server)             // grpc server register
	RegisterHandler(*runtime.ServeMux) error // grpc gateway handler register
}

IModule 模块接口

type Interceptor

type Interceptor struct {
}

Interceptor grpc service interceptor

type Manager

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

Manager 服务模块控制器

func Instance

func Instance() *Manager

Instance return module manager

func NewManager

func NewManager(srv *grpc.Server, mux *runtime.ServeMux) (*Manager, error)

NewManager module manager. If grpc gateway not implementation,should be nil

func (*Manager) Enable

func (m *Manager) Enable(modules ...IModule) (err error)

Enable enable module

Directories

Path Synopsis
features

Jump to

Keyboard shortcuts

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