Documentation ¶
Index ¶
Constants ¶
View Source
const APNS = "apns"
APNS string representation
View Source
const GCM = "gcm"
GCM string representation
Variables ¶
This section is empty.
Functions ¶
func WaitTimeout ¶
WaitTimeout waits for the waitgroup for the specified max timeout. Returns true if waiting timed out. got from http://stackoverflow.com/a/32843750/3987733
Types ¶
type Handler ¶
type Handler struct { Config *viper.Viper FeedbackCache map[string]map[string]int FlushInterval time.Duration MarathonDB *extensions.PGClient Logger zap.Logger // contains filtered or unexported fields }
Handler is a feedback handler
func NewHandler ¶
func NewHandler(config *viper.Viper, logger zap.Logger, pendingMessagesWG *sync.WaitGroup, DBOrNil ...*extensions.PGClient) (*Handler, error)
NewHandler creates a new instance of feedback.Handler
func (*Handler) HandleMessages ¶
HandleMessages get messages from msgChan
type Listener ¶
type Listener struct { Config *viper.Viper ConfigFile string Queue interfaces.Queue Logger zap.Logger FeedbackHandler *Handler GracefulShutdownTimeout int // contains filtered or unexported fields }
Listener will consume push feedbacks from a queue and update job feedbacks column
func NewListener ¶
NewListener creates and return a new instance of feedback.Listener
type Message ¶
type Message struct { From string `json:"from"` MessageID string `json:"message_id"` MessageType string `json:"message_type"` Error string `json:"error"` ErrorDescription string `json:"error_description"` DeviceToken string `json:"DeviceToken"` ID string `json:"id"` Err map[string]interface{} `json:"Err"` Metadata map[string]interface{} `json:"metadata"` }
Message is a struct that will decode a apns or gcm feedback message
Click to show internal directories.
Click to hide internal directories.