simpleping

package module
v0.0.0-...-9adffdc Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: GPL-3.0 Imports: 16 Imported by: 0

README

simpleping

Get notified via FB messenger when your favorite site goes down

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedisInstance *redisutil.RedisInstance
View Source
var Subcribers []string

Functions

func DailyUpdatePing

func DailyUpdatePing(url string)

func FBWebhook

func FBWebhook(w http.ResponseWriter, r *http.Request)

func PingURL

func PingURL(url string)

Types

type Attachment

type Attachment struct {
	Type    string  `json:"type,omitempty"`
	Payload Payload `json:"payload,omitempty"`
}

Attachment represents attachment data of a message exchanged on Messenger

type Button

type Button struct {
	Type    string `json:"type,omitempty"`
	URL     string `json:"url,omitempty"`
	Title   string `json:"title,omitempty"`
	Payload string `json:"payload,omitempty"`
}

Button represents button of a message on Messenger

type CTA

type CTA struct {
	Payload string `json:"payload,omitempty"`
}

CTA represents call to action payload information of a message

type DeliveryData

type DeliveryData struct {
	MIDs      []string `json:"mids,omitempty"`
	Watermark big.Int  `json:"watermark,omitempty"`
	Sequence  int      `json:"seq,omitempty"`
}

DeliveryData represents delivery data of a message exchanged on Messenger

type Element

type Element struct {
	Title    string   `json:"title,omitempty"`
	Subtitle string   `json:"subtitle,omitempty"`
	ItemURL  string   `json:"item_url,,omitempty"`
	ImageURL string   `json:"image_url,omitempty"`
	Buttons  []Button `json:"buttons,omitempty"`
}

Element represents element of a message on Messenger

type Entry

type Entry struct {
	ID        string    `json:"id,omitempty"`
	Time      big.Int   `json:"time,omitempty"`
	Messaging []Message `json:"messaging,omitempty"`
}

Entry represents each message entry sent by user on Messenger

type GetStartedTemplate

type GetStartedTemplate struct {
	SettingType   string `json:"setting_type,omitempty"`
	ThreadState   string `json:"thread_state,omitempty"`
	CallToActions []CTA  `json:"call_to_actions,omitempty"`
}

GetStartedTemplate Button initialization

type IncomingMessage

type IncomingMessage struct {
	Object  string   `json:"object,omitempty"`
	Entries *[]Entry `json:"entry,omitempty"`
}

IncomingMessage represents incoming message sent by user on Messenger

type Message

type Message struct {
	Sender      Sender       `json:"sender,omitempty"`
	Recipient   Recipient    `json:"recipient,omitempty"`
	Timestamp   big.Int      `json:"timestamp,omitempty"`
	MessageData MessageData  `json:"message,omitempty"`
	Read        ReadData     `json:"read,omitempty"`
	Delivery    DeliveryData `json:"delivery,omitempty"`
	Postback    *Postback    `json:"postback,omitempty"`
}

Message represents message exchanged on Messenger

type MessageData

type MessageData struct {
	IsEcho      bool          `json:"is_echo,omitempty"`
	AppID       big.Int       `json:"app_id,omitempty"`
	MID         string        `json:"mid,omitempty"`
	Sequence    int           `json:"seq,omitempty"`
	StickerID   *big.Int      `json:"sticker_id,omitempty"`
	Text        string        `json:"text,omitempty"`
	Attachments *[]Attachment `json:"attachments,omitempty"`
}

MessageData represents message data of a message exchanged on Messenger

type OutgoingAttachmentData

type OutgoingAttachmentData struct {
	Type    string   `json:"type,omitempty"`
	Payload *Payload `json:"payload,omitempty"`
}

OutgoingAttachmentData represents outgoing attachment data to be sent back to user on Messenger

type OutgoingMessage

type OutgoingMessage struct {
	Recipient Recipient            `json:"recipient,omitempty"`
	Message   *OutgoingMessageData `json:"message,omitempty"`

	SenderAction string `json:"sender_action,omitempty"`
}

OutgoingMessage represents outgoing message to be sent back to user on Messenger

type OutgoingMessageData

type OutgoingMessageData struct {
	Text       string                  `json:"text,omitempty"`
	Attachment *OutgoingAttachmentData `json:"attachment,omitempty"`
}

OutgoingMessageData represents outgoing message data to be sent back to user on Messenger

type Payload

type Payload struct {
	TemplateType string     `json:"template_type,omitempty"`
	Elements     *[]Element `json:"elements,omitempty"`
	URL          string     `json:"url,omitempty"`
	StickerID    *big.Int   `json:"sticker_id,omitempty"`
}

Payload represents payload data of a message exchanged on Messenger

type Postback

type Postback struct {
	Payload string `json:"payload,omitempty"`
}

Postback represents postback data sent by user on Messenger

type ReadData

type ReadData struct {
	Watermark big.Int `json:"watermark,omitempty"`
	Sequence  int     `json:"seq,omitempty"`
}

ReadData represents read data of a message exchanged on Messenger

type Recipient

type Recipient struct {
	ID string `json:"id,omitempty"`
}

Recipient represents recipient data of a message exchanged on Messenger

type Sender

type Sender struct {
	ID string `json:"id,omitempty"`
}

Sender represents sender data of a message exchanged on Messenger

Directories

Path Synopsis
cmd
scheduleping command
simpleping command

Jump to

Keyboard shortcuts

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