linenotify

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 7 Imported by: 0

README

go-linenotify

Helper functions for sending message by LINE Notify API.

CI

Install

go get github.com/yyotti/go-linenotify

Example

package main

import (
	"context"
	"log"

	"github.com/yyotti/go-linenotify"
)

const authToken = "[LINE Notify Authorization Token]"

func main() {
	notifier, err := linenotify.New(authToken)
	if err != nil {
		log.Fatal(err)
	}

	err = notifier.Send(context.Background(), "Hello!")
	if err != nil {
		log.Fatal(err)
	}
}

Documentation

Overview

Package linenotify provides notify function by LINE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier interface {
	Send(ctx context.Context, message string) error
}

func New

func New(token string) (Notifier, error)

type NotifyResponse

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

func (*NotifyResponse) Error

func (r *NotifyResponse) Error() string

Jump to

Keyboard shortcuts

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