lino

package module
v0.0.0-...-34a0786 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 6 Imported by: 0

README

LINO

The Line notification library for Golang.

Go Report Card Coverage Status

Install

$ go get -u github.com/tishibas/lino

Support

Currently, this library only supports Notify(POST https://notify-api.line.me/api/notify).

Hello, world

Here is a simple "Hello, world" example for LINE notification.

c := lino.New(&Config{
		AccessToken: "<ACCESS_TOKEN>",
    })

// only message
c.Notify(&lino.RequestNotify{
    Message: "message",
})

// message with images
imageThumbnail := "https://example.com/foo.jpg"
imageFullsize := "https://exmaple.com/bar.jpg"
c.Notify(&lino.RequestNotify{
    Message:        "message",
    ImageThumbnail: &imageThumbnail
    ImageFullsize:  &imageFullsize,
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(c *Config) *Client

func (*Client) Notify

func (c *Client) Notify(r *RequestNotify) error

type Config

type Config struct {
	AccessToken string
	HttpClient  *http.Client
}

type RequestNotify

type RequestNotify struct {
	Message              string
	ImageThumbnail       *string
	ImageFullsize        *string
	StickerPackageID     *int
	StickerID            *int
	NotificationDisabled bool
}

Jump to

Keyboard shortcuts

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