linenotify

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: MIT Imports: 12 Imported by: 0

README

go-linenotify

GoDoc Reference Build Status GitHub release

Go client library for the LINE Notify

Install

go get github.com/utahta/go-linenotify

Example

Contributing

  1. Fork it ( https://github.com/utahta/go-linenotify/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotifyInvalidAccessToken = errors.New("invalid access token")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
}

Client calls LINE Notify API. refs https://notify-bot.line.me/doc/

func New

func New() *Client

New returns *Client

func (*Client) Notify

func (c *Client) Notify(token, message, imageThumbnail, imageFullsize string, image io.Reader) (*NotifyResponse, error)

Notify provides convenient Notify* interface

func (*Client) NotifyMessage added in v0.4.2

func (c *Client) NotifyMessage(token, message string) (*NotifyResponse, error)

NotifyMessage notify text message

func (*Client) NotifyWithImage

func (c *Client) NotifyWithImage(token, message string, image io.Reader) (*NotifyResponse, error)

NotifyWithImage notify text message and image by binary

func (*Client) NotifyWithImageURL

func (c *Client) NotifyWithImageURL(token, message, imageThumbnail, imageFullsize string) (*NotifyResponse, error)

NotifyWithImageURL notify text message and image by url

type NotifyResponse

type NotifyResponse struct {
	Status    int    `json:"status"`
	Message   string `json:"message"`
	RateLimit RateLimit
}

NotifyResponse represents response that LINE Notify API

type RateLimit

type RateLimit struct {
	Limit          int
	Remaining      int
	ImageLimit     int
	ImageRemaining int
	Reset          time.Time
}

RateLimit

func (*RateLimit) Parse

func (r *RateLimit) Parse(header http.Header)

Parse parses rate limit from response header

Directories

Path Synopsis
_example

Jump to

Keyboard shortcuts

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