Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiHandlerWrap ¶
ApiHandlerWrap 路由自动校验入参 + 格式化返回值
Types ¶
type Options ¶
type Options struct {
Server server.Server
Client client.Client
// Before and After funcs
BeforeStart []func() error
BeforeStop []func() error
AfterStart []func() error
AfterStop []func() error
// Other options for implementations of the interface
// can be stored in a context
Context context.Context
Signal bool
}
Options for micro service
type ResponseData ¶
data part:
type Service ¶
type Service interface {
// The service name
Name() string
// Init initialises options
Init(...Option)
// Options returns the current options
Options() Options
// Client is used to call services
Client() client.Client
// Server is for handling requests and events
Server() server.Server
// Run the service
Run() error
// The service implementation
String() string
}
Service is an interface that wraps the lower level libraries within go-micro. Its a convenience method for building and initialising services.
func NewService ¶
NewService creates and returns a new Service based on the packages within.
Click to show internal directories.
Click to hide internal directories.