Documentation
¶
Overview ¶
Package services defines an interface for canary services and related implementations
Package services defines an interface for canary services and related implementations ¶
Package services defines some canary related services ¶
Package services defines some canary related services ¶
Package services defines an interface for canary services and related implementations ¶
Package services defines some canary related services ¶
Package services defines some canary related services ¶
Package services defines some canary related services
Index ¶
- Constants
- Variables
- func LivenessHandler() http.Handler
- func ReadinessHandler() http.Handler
- type Backoff
- type BackoffDelayOverflow
- type CanaryMessage
- type ConnectionService
- type ConsumerService
- type ConsumingStatus
- type ErrExpectedClusterSize
- type MaxAttemptsExceeded
- type ProducerService
- type Status
- type StatusService
- type TopicReconcileResult
- type TopicService
Constants ¶
const ( ScaleDefault = 200 * time.Millisecond MaxDefault = 5 * time.Minute MaxAttemptsDefault = 6 )
Variables ¶
var (
RecordsConsumedCounter uint64 = 0
)
var (
RecordsProducedCounter uint64 = 0
)
Functions ¶
func LivenessHandler ¶
func ReadinessHandler ¶
Types ¶
type Backoff ¶
type Backoff struct {
// contains filtered or unexported fields
}
Backoff encapsulates computing delays for an exponential back-off, when an operation has to be retried
func NewBackoff ¶
NewBackoff returns an instance of a Backoff struct
type BackoffDelayOverflow ¶
type BackoffDelayOverflow struct{}
Overflow on computed delay
func (*BackoffDelayOverflow) Error ¶
func (e *BackoffDelayOverflow) Error() string
type CanaryMessage ¶
type CanaryMessage struct { ProducerID string `json:"producerId"` MessageID int `json:"messageId"` Timestamp int64 `json:"timestamp"` }
CanaryMessage defines the payload of a canary message
func NewCanaryMessage ¶
func NewCanaryMessage(bytes []byte) CanaryMessage
func (CanaryMessage) Json ¶
func (cm CanaryMessage) Json() string
func (CanaryMessage) String ¶
func (cm CanaryMessage) String() string
type ConnectionService ¶
type ConnectionService interface { Open() Close() }
func NewConnectionService ¶
func NewConnectionService(canaryConfig *config.CanaryConfig, saramaConfig *sarama.Config) ConnectionService
NewConnectionService returns an instance of ConnectionService
type ConsumerService ¶
ConsumerService defines the service for consuming messages
func NewConsumerService ¶
func NewConsumerService(canaryConfig *config.CanaryConfig, client sarama.Client) ConsumerService
NewConsumerService returns an instance of ConsumerService
type ConsumingStatus ¶
ConsumingStatus defines consuming related status information
type ErrExpectedClusterSize ¶
type ErrExpectedClusterSize struct{}
ErrExpectedClusterSize defines the error raised when the expected cluster size is not met
func (*ErrExpectedClusterSize) Error ¶
func (e *ErrExpectedClusterSize) Error() string
type MaxAttemptsExceeded ¶
type MaxAttemptsExceeded struct{}
MaxAttemptsExceeded defines the error for the max attempts exceeded
func (*MaxAttemptsExceeded) Error ¶
func (e *MaxAttemptsExceeded) Error() string
type ProducerService ¶
func NewProducerService ¶
func NewProducerService(canaryConfig *config.CanaryConfig, client sarama.Client) ProducerService
NewProducerService returns an instance of ProductService
type Status ¶
type Status struct {
Consuming ConsumingStatus
}
Status defines useful status related information
type StatusService ¶
func NewStatusServiceService ¶
func NewStatusServiceService(canaryConfig *config.CanaryConfig) StatusService
NewStatusService returns an instance of StatusService
type TopicReconcileResult ¶
type TopicReconcileResult struct { // new partitions assignments across brokers Assignments map[int32][]int32 // partition to leader assignments Leaders map[int32]int32 // if a refresh metadata is needed RefreshProducerMetadata bool }
TopicReconcileResult contains the result of a topic reconcile
type TopicService ¶
type TopicService interface { Reconcile() (TopicReconcileResult, error) Close() }
func NewTopicService ¶
func NewTopicService(canaryConfig *config.CanaryConfig, saramaConfig *sarama.Config) TopicService
NewTopicService returns an instance of TopicService