Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvKeyChannelSecret = "CHANNEL_SECRET" EnvKeyChannelAccessToken = "CHANNEL_ACCESS_TOKEN" )
environment variable key
Variables ¶
View Source
var ( // ErrEmptyMessages - []linebot.SendingMessage is empty ErrEmptyMessages = xerrors.Errorf("no message to send") // ErrNoSetFunction - function to be executed individually is not set ErrNoSetFunction = xerrors.Errorf("no set function") // ErrInvalidMessageType - invalid message type ErrInvalidMessageType = xerrors.Errorf("invalid message type") )
Functions ¶
func ParseEvents ¶
ParseEvents - extract `[]*linebot.Event`
func ValidateSignature ¶
ValidateSignature - perform signature verification
Types ¶
type AppEngineProps ¶
type AppEngineProps interface { SetService(service string) ParentEvent(ctx context.Context, body []byte) error ChildEvent(ctx context.Context, body []byte) error Props }
AppEngineProps - props for App Engine.
func NewAppEngineProps ¶
func NewAppEngineProps(client *cloudtasks.Client, queuePath, relativeURI string) AppEngineProps
NewAppEngineProps - constructor
type CloudFunctionsProps ¶
type CloudFunctionsProps interface { ParentEvent(ctx context.Context, message *pubsub.Message) error ChildEvent(ctx context.Context, message *pubsub.Message) error Props }
CloudFunctionsProps - props for Cloud Functions.
func NewCloudFunctionsProps ¶
func NewCloudFunctionsProps(parent, child *pubsub.Topic) CloudFunctionsProps
NewCloudFunctionsProps - constructor
type EventType ¶
type EventType = string
EventType - Event type Name
const ( EventTypeTextMessage EventType = "TextMessage" EventTypeImageMessage EventType = "ImageMessage" EventTypeVideoMessage EventType = "VideoMessage" EventTypeAudioMessage EventType = "AudioMessage" EventTypeFileMessage EventType = "FileMessage" EventTypeLocationMessage EventType = "LocationMessage" EventTypeStickerMessage EventType = "StickerMessage" EventTypeFollowEvent EventType = "follow" EventTypeUnfollowEvent EventType = "unfollow" EventTypeJoinEvent EventType = "join" EventTypeLeaveEvent EventType = "leave" EventTypeMemberJoinedEvent EventType = "memberJoined" EventTypeMemberLeftEvent EventType = "memberLeft" EventTypePostBackEvent EventType = "postback" EventTypeBeaconEvent EventType = "beacon" EventTypeAccountLinkEvent EventType = "accountLink" EventTypeThingsEvent EventType = "things" EventTypeUnsend EventType = "unsend" EventTypeVideoPlayComplete EventType = "videoPlayComplete" )
event Name
type GCPine ¶
type GCPine struct { ErrMessages []linebot.SendingMessage Function map[EventType]PineFunction LiffFunc map[string]PineLiffFunc *linebot.Client }
GCPine - Toolkit of the LINE Bot to work for Google Cloud Platform.
func (*GCPine) SendPushMessage ¶
func (g *GCPine) SendPushMessage(uid string, messages []linebot.SendingMessage) error
SendPushMessage - send push message
func (*GCPine) SendReplyMessage ¶
func (g *GCPine) SendReplyMessage(token string, messages []linebot.SendingMessage) error
SendReplyMessage - send reply message
type PineFunction ¶
type PineFunction func(ctx context.Context, pine *GCPine, event *linebot.Event) ([]linebot.SendingMessage, error)
PineFunction - Event function for reply
type PineLiffFunc ¶
type PineLiffFunc func(r *http.Request, w http.ResponseWriter)
PineLiffFunc - Functions for LIFF(TODO function)
Click to show internal directories.
Click to hide internal directories.