notihub

package
v0.0.0-...-fff5761 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package notihub represents an http client for microsoft azure notification hub

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HubClient

type HubClient interface {
	Exec(req *http.Request) ([]byte, error)
}

type Notification

type Notification struct {
	Format  NotificationFormat
	Payload []byte
}

func NewNotification

func NewNotification(format NotificationFormat, payload []byte) (*Notification, error)

NewNotification initalizes and returns Notification pointer

func (*Notification) String

func (n *Notification) String() string

String returns Notification string representation

type NotificationFormat

type NotificationFormat string
const (
	Template           NotificationFormat = "template"
	AndroidFormat      NotificationFormat = "gcm"
	AppleFormat        NotificationFormat = "apple"
	BaiduFormat        NotificationFormat = "baidu"
	KindleFormat       NotificationFormat = "adm"
	WindowsFormat      NotificationFormat = "windows"
	WindowsPhoneFormat NotificationFormat = "windowsphone"
)

func (NotificationFormat) GetContentType

func (f NotificationFormat) GetContentType() string

GetContentType returns Content-Type associated with NotificationFormat

func (NotificationFormat) IsValid

func (f NotificationFormat) IsValid() bool

IsValid identifies whether notification format is valid

type NotificationHub

type NotificationHub struct {
	// contains filtered or unexported fields
}

func NewNotificationHub

func NewNotificationHub(connectionString, hubPath string) *NotificationHub

NewNotificationHub initializes and returns NotificationHub pointer

func (*NotificationHub) Schedule

func (h *NotificationHub) Schedule(n *Notification, orTags []string, deliverTime time.Time) ([]byte, error)

Schedule pusblishes a scheduled notification to azure notification hub

func (*NotificationHub) Send

func (h *NotificationHub) Send(n *Notification, orTags []string) ([]byte, error)

Send publishes notification to the azure hub

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL