-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenki.go
27 lines (23 loc) · 799 Bytes
/
genki.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package genki
import (
"github.com/lukasjarosch/genki/broker"
"github.com/lukasjarosch/genki/server"
)
// Application defines the application interface. It's designed to be simple and straightforward.
type Application interface {
// Name of the application
Name() string
// Run the application. This is a blocking call and will only return if the
// server is shut-down or an error occurred.
Run() error
// Opts returns the current options
Opts() Options
// AddServer registers a new server with the application
AddServer(server server.Server)
// RegisterBroker registers a message broker implementation (AMQP, NATS, ...)
RegisterBroker(broker broker.Broker)
}
type Option func(options *Options)
func NewApplication(options ...Option) Application {
return newService(options...)
}