api

package
v0.0.0-...-cb3295b Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestResponseIsNot200 = "Request doesn't succeeded"
	SetContentTypeFail      = "Cannot assume content type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func NewApi

func NewApi(apiId string, botNo string, consumerKey string, serverListId string, serverPrivateKey []byte, ssl bool, domain string) *Api

func NewApiDefault

func NewApiDefault(apiId string, botNo string, consumerKey string, serverListId string, serverPrivateKey []byte) *Api

func (*Api) GetContent

func (api *Api) GetContent(resourceId string) ([]byte, error)

func (*Api) SendRequest

func (api *Api) SendRequest(arg Request) (interface{}, error)

type ButtonActionMessage

type ButtonActionMessage struct {
	Label    string `json:"label"`
	Postback string `json:"postback"`
	// contains filtered or unexported fields
}

func NewButtonActionMessage

func NewButtonActionMessage(label string, postback string) ButtonActionMessage

type ButtonActionUri

type ButtonActionUri struct {
	Label string `json:"label"`
	Uri   string `json:"uri"`
	// contains filtered or unexported fields
}

Button

func NewButtonActionUri

func NewButtonActionUri(label string, uri string) ButtonActionUri

type ButtonContent

type ButtonContent struct {
	ContentText string      `json:"contentText"`
	Actions     interface{} `json:"actions"`
	// contains filtered or unexported fields
}

func NewButtonContent

func NewButtonContent(contentText string, actions interface{}) ButtonContent

type ImageContent

type ImageContent struct {
	PreviewUrl  string `json:"previewUrl"`
	ResourceUrl string `json:"resourceUrl"`
	// contains filtered or unexported fields
}

Image

func NewImageContent

func NewImageContent(previewUrl string, resourceUrl string) ImageContent

type LinkContent

type LinkContent struct {
	ContentText string `json:"contentText"`
	LinkText    string `json:"linkText"`
	Link        string `json:"link"`
	// contains filtered or unexported fields
}

Link

func NewLinkContent

func NewLinkContent(contentText string, linkText string, link string) LinkContent

type Request

type Request struct {
	AccountId string      `json:"accountId"`
	RoomId    string      `json:"roomId"`
	Content   interface{} `json:"content"`
}

type StickerContent

type StickerContent struct {
	PackageId string `json:"packageId"`
	StickerId string `json:"stickerId"`
	// contains filtered or unexported fields
}

Sticker https://static.worksmobile.net/static/wm/media/message-bot-api/line_works_sticker_list_new.pdf

func NewStickerContent

func NewStickerContent(packageId string, stickerId string) StickerContent

type TextContent

type TextContent struct {
	Text string `json:"text"`
	// contains filtered or unexported fields
}

Text

func NewTextContent

func NewTextContent(text string) TextContent

Jump to

Keyboard shortcuts

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