line

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

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

Line struct holds info about client and destination ID for communicating with line API

func New

func New(channelSecret, channelAccessToken string) (*Line, error)

New creates a new instance of Line notifier service For more info about line api credential: -> https://github.com/line/line-bot-sdk-go

func NewWithHttpClient added in v0.43.0

func NewWithHttpClient(channelSecret, channelAccessToken string, client *http.Client) (*Line, error)

NewWithHttpClient creates a new instance of Line notifier service with linebot.ClientOption

func (*Line) AddReceivers

func (l *Line) AddReceivers(receiverIDs ...string)

AddReceivers receives user, group or room IDs then add them to internal receivers list

func (*Line) Send

func (l *Line) Send(ctx context.Context, subject, message string) error

Send receives message subject and body then sends it to all receivers set previously Subject will be on the first line followed by message on the next line

type Notify

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

Line Notify struct holds info about client and destination token for communicating with line API

func NewNotify

func NewNotify() *Notify

New creates a new instance of Line notify service For more info about line notify api: -> https://notify-bot.line.me/doc/en/

func (*Notify) AddReceivers

func (ln *Notify) AddReceivers(receiverTokens ...string)

AddReceivers receives token then add them to internal receivers list

func (*Notify) Send

func (ln *Notify) Send(ctx context.Context, subject, message string) error

Send receives message subject and body then sends it to all receivers set previously Subject will be on the first line followed by message on the next line

func (*Notify) SetHttpClient added in v0.43.0

func (ln *Notify) SetHttpClient(client *http.Client)

Jump to

Keyboard shortcuts

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