gntp

package module
v0.0.0-...-88aa4ee Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 14 Imported by: 4

README

go-gntp

GNTP client for Go

Usage

client := gntp.NewClient()
client.AppName = "my-app"
client.Server = "localhost:23053"
client.Password = "foobar"
client.HashAlgorithm = "SHA256"
client.EncryptAlgorithm = "AES"
n := []gntp.Notification{Event: "MyEvent", DisplayName: "My Event Name", Enabled: true}}
client.Register(n)
m := gntp.Message{Event: "MyEvent", Title: "my-title", Text: "my-text"}
client.Send(&m)

Installation

go get github.com/mattn/go-gntp

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Server           string
	Password         string
	AppName          string
	HashAlgorithm    string
	EncryptAlgorithm string
}

func NewClient

func NewClient() *Client

func (*Client) Notify

func (c *Client) Notify(m *Message) error

func (*Client) Register

func (c *Client) Register(n []Notification) error

type Message

type Message struct {
	Event       string
	Title       string
	Text        string
	Icon        string
	Callback    string
	DisplayName string
	Sticky      bool
}

type Notification

type Notification struct {
	Event       string
	DisplayName string
	Enabled     bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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