-
Notifications
You must be signed in to change notification settings - Fork 5
/
types.go
54 lines (42 loc) · 1.63 KB
/
types.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package commander
import (
"github.com/jeroenrinzema/commander/internal/options"
"github.com/jeroenrinzema/commander/internal/types"
)
// To avoid circular dependencies are some types/interfaces/structs moved to a seperate package (types).
// In order to still be able to use the types by simply importing commander are the types imported and extended in commander.
// Status codes that represents the status of a event
const (
StatusOK = types.StatusOK
StatusBadRequest = types.StatusBadRequest
StatusUnauthorized = types.StatusUnauthorized
StatusForbidden = types.StatusForbidden
StatusNotFound = types.StatusNotFound
StatusConflict = types.StatusConflict
StatusImATeapot = types.StatusImATeapot
StatusInternalServerError = types.StatusInternalServerError
)
// Available message types
const (
EventMessage = types.EventMessage
CommandMessage = types.CommandMessage
)
// Dialect extention of the Dialect type
type Dialect = types.Dialect
// Message a message
type Message = types.Message
// Available topic modes
const (
ConsumeMode = types.ConsumeMode
ProduceMode = types.ProduceMode
DefaultMode = types.DefaultMode
)
// NewTopic constructs a new commander topic for the given name, type, mode and dialect.
// If no topic mode is defined is the default mode (consume|produce) assigned to the topic.
var NewTopic = options.NewTopic
// Topic contains information of a kafka topic
type Topic = types.Topic
// NewMessage types.NewMessage alias
var NewMessage = types.NewMessage
// WithJSONCodec options.WithJSONCodec alias
var WithJSONCodec = options.WithJSONCodec