traqwriter

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 7 Imported by: 0

README

traq-writer

godoc-badge goreport-badge

traq-writer posts messages to traQ via webhook.

Example

Please see ./example/main.go.

After executing this, you can see the following message in traQ.

image

Documentation

Index

Constants

View Source
const (
	// DefaultHTTPOrigin is the default HTTP origin of traQ
	DefaultHTTPOrigin = "https://q.trap.jp"
)

Variables

This section is empty.

Functions

func CalcHMACSHA1

func CalcHMACSHA1(secret string, p []byte) string

CalcHMACSHA1 calculates an HMAC with SHA1

Types

type TraqWebhookWriter

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

TraqWebhookWriter implements io.Writer

func NewTraqWebhookWriter

func NewTraqWebhookWriter(id, secret, origin string) *TraqWebhookWriter

NewTraqWebhookWriter returns a new pointer of TraqWebhookWriter

func (*TraqWebhookWriter) ResetChannelID added in v1.2.0

func (w *TraqWebhookWriter) ResetChannelID()

ResetChannelID resets a channel ID

func (*TraqWebhookWriter) SetChannelID added in v1.2.0

func (w *TraqWebhookWriter) SetChannelID(channelID string)

SetChannelID sets a channel ID

func (*TraqWebhookWriter) Write

func (w *TraqWebhookWriter) Write(p []byte) (n int, err error)

Write posts a message to traQ via webhook

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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