Documentation ¶
Index ¶
- type APNSPushQueueMock
- type GCMClientMock
- type KafkaConsumerClientMock
- func (k *KafkaConsumerClientMock) Assign(partitions []kafka.TopicPartition) error
- func (k *KafkaConsumerClientMock) Close() error
- func (k *KafkaConsumerClientMock) Events() chan kafka.Event
- func (k *KafkaConsumerClientMock) SubscribeTopics(topics []string, callback kafka.RebalanceCb) error
- func (k *KafkaConsumerClientMock) Unassign() error
- type KafkaProducerClientMock
- type MockEvent
- type PGMock
- func (m *PGMock) Close() error
- func (m *PGMock) Exec(obj interface{}, params ...interface{}) (*types.Result, error)
- func (m *PGMock) ExecOne(obj interface{}, params ...interface{}) (*types.Result, error)
- func (m *PGMock) Query(obj interface{}, query interface{}, params ...interface{}) (*types.Result, error)
- type StatsDClientMock
- func (m *StatsDClientMock) Close() error
- func (m *StatsDClientMock) Gauge(bucket string, value float64, tags []string, rate float64) error
- func (m *StatsDClientMock) Incr(bucket string, tags []string, rate float64) error
- func (m *StatsDClientMock) Timing(bucket string, value time.Duration, tags []string, rate float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APNSPushQueueMock ¶ added in v0.2.0
type APNSPushQueueMock struct { Closed bool // contains filtered or unexported fields }
APNSPushQueueMock should be used for tests that need to send pushs to APNS
func NewAPNSPushQueueMock ¶ added in v0.2.0
func NewAPNSPushQueueMock() *APNSPushQueueMock
NewAPNSPushQueueMock creates a new instance
func (*APNSPushQueueMock) Close ¶ added in v0.2.0
func (m *APNSPushQueueMock) Close()
Close records that it is closed
func (*APNSPushQueueMock) Configure ¶
func (m *APNSPushQueueMock) Configure() error
func (*APNSPushQueueMock) Push ¶ added in v0.2.0
func (m *APNSPushQueueMock) Push(*apns2.Notification)
Push records the sent message in the MessagesSent collection
func (*APNSPushQueueMock) ResponseChannel ¶
func (m *APNSPushQueueMock) ResponseChannel() chan *structs.ResponseWithMetadata
ResponseChannel returns responseChannel
type GCMClientMock ¶
type GCMClientMock struct { MessagesSent []gcm.XMPPMessage Closed bool }
GCMClientMock should be used for tests that need to send xmpp messages to GCM
func NewGCMClientMock ¶
func NewGCMClientMock() *GCMClientMock
NewGCMClientMock creates a new instance
func (*GCMClientMock) Close ¶ added in v0.2.0
func (m *GCMClientMock) Close() error
Close records that it is closed
func (*GCMClientMock) SendXMPP ¶
func (m *GCMClientMock) SendXMPP(msg gcm.XMPPMessage) (string, int, error)
SendXMPP records the sent message in the MessagesSent collection
type KafkaConsumerClientMock ¶ added in v0.2.0
type KafkaConsumerClientMock struct { SubscribedTopics map[string]interface{} EventsChan chan kafka.Event AssignedPartitions []kafka.TopicPartition Closed bool Error error }
KafkaConsumerClientMock should be used for tests that need to send messages to Kafka
func NewKafkaConsumerClientMock ¶ added in v0.2.0
func NewKafkaConsumerClientMock(errorOrNil ...error) *KafkaConsumerClientMock
NewKafkaConsumerClientMock creates a new instance
func (*KafkaConsumerClientMock) Assign ¶ added in v0.2.0
func (k *KafkaConsumerClientMock) Assign(partitions []kafka.TopicPartition) error
Assign mock
func (*KafkaConsumerClientMock) Close ¶ added in v0.2.0
func (k *KafkaConsumerClientMock) Close() error
Close mock
func (*KafkaConsumerClientMock) Events ¶ added in v0.2.0
func (k *KafkaConsumerClientMock) Events() chan kafka.Event
Events mock
func (*KafkaConsumerClientMock) SubscribeTopics ¶ added in v0.2.0
func (k *KafkaConsumerClientMock) SubscribeTopics(topics []string, callback kafka.RebalanceCb) error
SubscribeTopics mock
func (*KafkaConsumerClientMock) Unassign ¶ added in v0.2.0
func (k *KafkaConsumerClientMock) Unassign() error
Unassign mock
type KafkaProducerClientMock ¶ added in v0.2.0
type KafkaProducerClientMock struct { EventsChan chan kafka.Event ProduceChan chan *kafka.Message SentMessages int }
KafkaProducerClientMock should be used for tests that need to send messages to Kafka
func NewKafkaProducerClientMock ¶ added in v0.2.0
func NewKafkaProducerClientMock() *KafkaProducerClientMock
NewKafkaProducerClientMock creates a new instance
func (*KafkaProducerClientMock) Events ¶ added in v0.2.0
func (k *KafkaProducerClientMock) Events() chan kafka.Event
Events returns the mock events channel
func (*KafkaProducerClientMock) ProduceChannel ¶ added in v0.2.0
func (k *KafkaProducerClientMock) ProduceChannel() chan *kafka.Message
ProduceChannel returns the mock produce channel
func (*KafkaProducerClientMock) StartConsumingMessagesInProduceChannel ¶ added in v0.2.0
func (k *KafkaProducerClientMock) StartConsumingMessagesInProduceChannel()
StartConsumingMessagesInProduceChannel starts to consume messages in produce channel and incrementing sentMessages
type PGMock ¶ added in v0.2.0
type PGMock struct { Execs [][]interface{} ExecOnes [][]interface{} Queries [][]interface{} Closed bool RowsAffected int RowsReturned int Error error }
PGMock should be used for tests that need to connect to PG
type StatsDClientMock ¶ added in v0.2.0
type StatsDClientMock struct { Count map[string]int Gauges map[string]interface{} Timings map[string]interface{} Closed bool }
StatsDClientMock should be used for tests that need to send xmpp messages to StatsD
func NewStatsDClientMock ¶ added in v0.2.0
func NewStatsDClientMock() *StatsDClientMock
NewStatsDClientMock creates a new instance
func (*StatsDClientMock) Close ¶ added in v0.2.0
func (m *StatsDClientMock) Close() error
Close records that it is closed