Documentation ¶
Index ¶
- Variables
- func AddPrefix(s string)
- func BeforeStart(f ...func())
- func CommonProcess()
- func InitNatsBroker(b broker.Broker, options ...broker.Option)
- func InitNsqBroker(b broker.Broker, options ...broker.Option)
- func InitRabbitBroker(b broker.Broker, options ...broker.Option)
- func NewNatsBroker(opts ...broker.Option) broker.Broker
- func NewNsqBroker(opts ...broker.Option) broker.Broker
- func NewRabbitBroker(opts ...broker.Option) broker.Broker
- func Publish(b broker.Broker, topic string, data []byte, opts ...broker.PublishOption) string
- func Run()
- func RunProcess(process func(context.Context, context.CancelFunc) error)
- func RunWeb()
- func SetName(s string)
- func SetVersion(version string)
- func Subscribe(b broker.Broker, topic string, handle func(broker.Event) error, ...)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RabbitBroker = rabbitmq.NewBroker() NatsBroker = nats.NewBroker() NsqBroker = nsq.NewBroker() )
View Source
var ( Conf = config.NewConfig() Service = micro.NewService( micro.Flags( cli.StringFlag{ Name: "dataCenter", Usage: "dataCenter dc1", Value: "", }, cli.StringFlag{ Name: "prefix", Usage: "prefix /nebula/", Value: "/nebula/", }, cli.StringFlag{ Name: "confAddr", Usage: "confAddr localhost:8500", Value: "localhost:8500", }, cli.StringFlag{ Name: "appId", Usage: "appId default", Value: "default", }, cli.BoolFlag{ Name: "t", Usage: "-t", }, ), micro.Action(func(c *cli.Context) { dataCenter = c.String("dataCenter") DefaultPrefix = c.String("prefix") confAddr = c.String("confAddr") AppId = c.String("appId") test = c.Bool("t") }), ) Web web.Service DefaultPrefix string PrefixSlice []string AppId string )
Functions ¶
func BeforeStart ¶ added in v1.18.8
func BeforeStart(f ...func())
func CommonProcess ¶ added in v1.18.7
func CommonProcess()
func RunProcess ¶ added in v1.17.5
func RunProcess(process func(context.Context, context.CancelFunc) error)
func SetVersion ¶ added in v1.18.7
func SetVersion(version string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.