/
interfaces.go
38 lines (33 loc) · 1019 Bytes
/
interfaces.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
package core
import (
"context"
"time"
"github.com/shipperizer/kilo-franz/config"
"github.com/shipperizer/kilo-franz/encoder"
)
// ReaderConfigInterface is the core.Reader config interface, embeds config.ConfigInterface
type ReaderConfigInterface interface {
config.ConfigInterface
GetBootstrapServers() []string
GetTopic() string
GetGroupID() string
GetReadTimeout() time.Duration
Workers() int
}
// WriterConfigInterface is the core.Writer config interface, embeds config.ConfigInterface
type WriterConfigInterface interface {
config.ConfigInterface
GetBrokers() []string
GetTopic() string
GetNickname() string
GetAsync() bool
GetEncoder() encoder.EncoderInterface
}
// RefreshableInterface is implemented by core.Writer and core.Reader so that they can be refreshed by AutoRefreshX
type RefreshableInterface interface {
Get(context.Context) (interface{}, error)
Config() interface{}
Close()
Stats() interface{}
Renew(config.TLSConfigInterface, config.SASLConfigInterface, ...interface{})
}