go-sarah: github.com/oklahomer/go-sarah/alerter/line Index | Files

package line

import "github.com/oklahomer/go-sarah/alerter/line"

Package line provides sarah.Alerter implementation for LINE Notify.


Package Files



var Endpoint = "https://notify-api.line.me/api/notify"

Endpoint defines the API endpoint to be used for notification.

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client is an API client for LINE notification.

func New Uses

func New(config *Config, options ...Option) *Client

New creates and returns new Client instant.

func (*Client) Alert Uses

func (c *Client) Alert(ctx context.Context, botType sarah.BotType, err error) error

Alert sends alert message to notify critical state of caller.

type Config Uses

type Config struct {
    Token          string        `json:"token" yaml:"token"`
    RequestTimeout time.Duration `json:"timeout" yaml:"timeout"`

Config contains some configuration variables for gitter Adapter.

func NewConfig Uses

func NewConfig() *Config

NewConfig returns initialized Config struct with default settings. Token is empty at this point. Token can be set by feeding this instance to json.Unmarshal/yaml.Unmarshal, or direct assignment.

type Option Uses

type Option func(*Client)

Option defines a function signature that New()'s functional options must satisfy.

func WithHTTPClient Uses

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient creates an Option that replaces http.DefaultClient with preferred one.

Package line imports 7 packages (graph). Updated 2020-09-27. Refresh now. Tools for package owners.