Documentation ¶
Index ¶
- Constants
- func CapabilityCheck(token string, msisdn string) (int, error)
- func GetAgentConfig(agent map[string]string) *jwt.Config
- func GetAgentFromFile(filename string) (map[string]string, error)
- func GetAgentTokenFromFile(filename string) (*oauth2.Token, error)
- func GetCarouselCardMessage(cardWidth string, cardContent []CardContent) []byte
- func GetMediaMessage(url string, suggestions []RBMSuggestion) []byte
- func GetRequestBody(res *http.Response) (string, error)
- func GetStandaloneCardMessage(title string, description string, imageUrl string, mediaSize string, ...) []byte
- func GetTextMessage(text string, suggestions []RBMSuggestion) []byte
- func JsonToStruct(data []byte) map[string]any
- func PrintBodyRequest(res *http.Response)
- func SendEvent(token string, msisdn string, event string, messageId string) error
- func SendMessage(agentId string, token string, msisdn string, message []byte) (string, int, error)
- func SendMultipleMessage(agentId string, token string, msisdn string, messages [][]byte) (string, int, error)
- func StructToJson(data any) []byte
- type ActionSuggestion
- func GetCreateCalendarEventSuggestion(text string, postbackData string, eventTitle string, eventDescription string, ...) ActionSuggestion
- func GetDialSuggestion(text string, postbackData string, phoneNumber string) ActionSuggestion
- func GetOpenUrlSuggestion(text string, postbackData string, url string) ActionSuggestion
- func GetShareLocationoSuggestion(text string, postbackData string) ActionSuggestion
- func GetViewLocationSuggestion(text string, postbackData string, lat string, long string, ...) ActionSuggestion
- type ActionSuggestionData
- type CardContent
- type CarouselCardMessage
- type CarouselCardMessageData
- type ContentInfo
- type ContentMessage
- type CreateCalendarEventAction
- type DialAction
- type LatLong
- type Media
- type MediaMessage
- type OpenUrlAction
- type RBMHelper
- func (h *RBMHelper) CapabilityCheck(msisdn string) (int, error)
- func (h *RBMHelper) SendEvent(msisdn string, event string, messageId string) error
- func (h *RBMHelper) SendMessage(msisdn string, message []byte) (string, int, error)
- func (h *RBMHelper) SendMultipleMessage(msisdn string, messages [][]byte) (string, int, error)
- func (h *RBMHelper) SetDebug(d bool)
- type RBMMessage
- type RBMRichCard
- type RBMSuggestion
- type RBMSuggestionAction
- type RBMSuggestionReply
- type ReplySuggestion
- type RichCardMessage
- type ShareLocationAction
- type StandaloneCardMessage
- type StandaloneCardMessageData
- type SuggestedReply
- type TextMessage
- type ViewLocatinoAction
Constants ¶
View Source
const ( MEDIA_HEIGHT_TALL string = "TALL" MEDIA_HEIGHT_MEDIUM string = "MEDIUM" MEDIA_HEIGHT_SMALL string = "SMALL" )
Variables ¶
This section is empty.
Functions ¶
func GetCarouselCardMessage ¶
func GetCarouselCardMessage(cardWidth string, cardContent []CardContent) []byte
func GetMediaMessage ¶
func GetMediaMessage(url string, suggestions []RBMSuggestion) []byte
func GetTextMessage ¶
func GetTextMessage(text string, suggestions []RBMSuggestion) []byte
func JsonToStruct ¶
func PrintBodyRequest ¶
func SendMessage ¶
func SendMultipleMessage ¶
func StructToJson ¶
Types ¶
type ActionSuggestion ¶
type ActionSuggestion struct {
Action RBMSuggestionAction `json:"action"`
}
func GetDialSuggestion ¶
func GetDialSuggestion(text string, postbackData string, phoneNumber string) ActionSuggestion
func GetOpenUrlSuggestion ¶
func GetOpenUrlSuggestion(text string, postbackData string, url string) ActionSuggestion
func GetShareLocationoSuggestion ¶
func GetShareLocationoSuggestion(text string, postbackData string) ActionSuggestion
func (ActionSuggestion) GetSuggestionType ¶ added in v0.1.3
func (s ActionSuggestion) GetSuggestionType() string
type ActionSuggestionData ¶
type ActionSuggestionData struct { Text string `json:"text"` PostbackData string `json:"postbackData"` FallbackUrl string `json:"fallbackUrl,omitempty"` OpenUrlAction *OpenUrlAction `json:"openUrlAction,omitempty"` DialAction *DialAction `json:"dialAction,omitempty"` ViewLocatinoAction *ViewLocatinoAction `json:"viewLocationAction,omitempty"` CreateCalendarEventAction *CreateCalendarEventAction `json:"createCalendarEventAction,omitempty"` }
func (ActionSuggestionData) GetSuggestionActionType ¶ added in v0.1.3
func (a ActionSuggestionData) GetSuggestionActionType() string
type CardContent ¶
type CardContent struct { Title string `json:"title"` Description string `json:"description"` Media Media `json:"media"` Suggestions []RBMSuggestion `json:"suggestions,omitempty"` }
func GetCardContent ¶
func GetCardContent(title string, description string, imageUrl string, mediaSize string, suggestions []RBMSuggestion) CardContent
type CarouselCardMessage ¶
type CarouselCardMessage struct {
CarouselCard CarouselCardMessageData `json:"carouselCard"`
}
func (CarouselCardMessage) GetRichCardType ¶ added in v0.1.3
func (s CarouselCardMessage) GetRichCardType() string
type CarouselCardMessageData ¶
type CarouselCardMessageData struct { CardWidth string `json:"cardWidth"` CardContents []CardContent `json:"cardContents"` }
type ContentInfo ¶
type ContentMessage ¶
type ContentMessage struct {
ContentMessage RBMMessage `json:"contentMessage"`
}
func GetTextMessageStruct ¶
func GetTextMessageStruct(text string, suggestions []RBMSuggestion) ContentMessage
type DialAction ¶
type DialAction struct {
PhoneNumber string `json:"phoneNumber"`
}
type Media ¶
type Media struct { Height string `json:"height"` ContentInfo ContentInfo `json:"contentInfo"` }
type MediaMessage ¶
type MediaMessage struct { ContentInfo ContentInfo `json:"contentInfo"` Suggestions []RBMSuggestion `json:"suggestions,omitempty"` }
func (MediaMessage) GetType ¶ added in v0.1.3
func (m MediaMessage) GetType() string
type OpenUrlAction ¶
type OpenUrlAction struct {
Url string `json:"url"`
}
type RBMHelper ¶
type RBMHelper struct {
// contains filtered or unexported fields
}
func (*RBMHelper) SendMessage ¶
func (*RBMHelper) SendMultipleMessage ¶
type RBMMessage ¶ added in v0.1.3
type RBMMessage interface {
GetType() string
}
type RBMRichCard ¶ added in v0.1.3
type RBMRichCard interface {
GetRichCardType() string
}
type RBMSuggestion ¶ added in v0.1.3
type RBMSuggestion interface {
GetSuggestionType() string
}
type RBMSuggestionAction ¶ added in v0.1.3
type RBMSuggestionAction interface {
GetSuggestionActionType() string
}
type RBMSuggestionReply ¶ added in v0.1.3
type RBMSuggestionReply interface {
GetSuggestionReplyType() string
}
type ReplySuggestion ¶
type ReplySuggestion struct {
Reply RBMSuggestionReply `json:"reply"`
}
func GetReplySuggestion ¶
func GetReplySuggestion(text string, postbackData string) ReplySuggestion
func (ReplySuggestion) GetSuggestionType ¶ added in v0.1.3
func (s ReplySuggestion) GetSuggestionType() string
type RichCardMessage ¶
type RichCardMessage struct {
RichCard RBMRichCard `json:"richCard"`
}
func (RichCardMessage) GetType ¶ added in v0.1.3
func (m RichCardMessage) GetType() string
type ShareLocationAction ¶
type ShareLocationAction struct{}
type StandaloneCardMessage ¶
type StandaloneCardMessage struct {
StandaloneCard StandaloneCardMessageData `json:"standaloneCard"`
}
func (StandaloneCardMessage) GetRichCardType ¶ added in v0.1.3
func (s StandaloneCardMessage) GetRichCardType() string
type StandaloneCardMessageData ¶
type StandaloneCardMessageData struct { ThumbnailImageAlignment string `json:"thumbnailImageAlignment"` CardOrientation string `json:"cardOrientation"` CardContent CardContent `json:"cardContent"` }
type SuggestedReply ¶
func (SuggestedReply) GetSuggestionReplyType ¶ added in v0.1.3
func (r SuggestedReply) GetSuggestionReplyType() string
type TextMessage ¶
type TextMessage struct { Text string `json:"text"` Suggestions []RBMSuggestion `json:"suggestions,omitempty"` }
func (TextMessage) GetType ¶ added in v0.1.3
func (m TextMessage) GetType() string
type ViewLocatinoAction ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.