Documentation ¶
Index ¶
- type ActionConfig
- type BasicCardType
- type ButtonType
- type CarouselHeaderType
- type CarouselType
- type CommerceCardType
- type ContextControl
- type LinkType
- type ListCardType
- type ListItemType
- type ProfileType
- type QuickRepliesType
- type SimpleImageType
- type SimpleTextType
- type SkillPayload
- type SkillResponse
- type SkillTemplate
- type ThumbnailType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionConfig ¶
type ActionConfig struct { WebLinkURL string `json:"webLinkUrl,omitempty"` MessageText string `json:"messageText,omitempty"` PhoneNumber string `json:"phoneNumber,omitempty"` BlockID map[string]interface{} `json:"blockId,omitempty"` }
ActionConfig represents actions
type BasicCardType ¶
type BasicCardType struct { BasicCard struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Thumbnail ThumbnailType `json:"thumbnail"` // Profile 미지원 Profile struct { ImageURL string `json:"imageUrl"` Nickname string `json:"nickname"` } `json:"profile,omitempty"` // Social 미지원 Social struct { Like int `json:"like"` Comment int `json:"comment"` Share int `json:"share"` } `json:"social,omitempty"` Buttons []ButtonType `json:"buttons,omitempty"` } `json:"basicCard"` }
BasicCardType is BasicCard template
func BasicCard ¶
func BasicCard(title string, description string, thumbnail ThumbnailType, buttons []ButtonType) BasicCardType
BasicCard creates BasicCard SkillResponse
type ButtonType ¶
type ButtonType struct { Label string `json:"label"` Action string `json:"action"` ActionConfig }
ButtonType is Button Template
func Button ¶
func Button(label string, action string, config ActionConfig) ButtonType
Button creates Button SkillResponse
type CarouselHeaderType ¶
type CarouselHeaderType struct { Title string `json:"title"` Description string `json:"description"` Thumbnail ThumbnailType `json:"thumbnail"` }
CarouselHeaderType is CarouselHeader Template which located in Carousel
func CarouselHeader ¶
func CarouselHeader(title string, description string, thumbnail ThumbnailType) CarouselHeaderType
CarouselHeader creates CarouselHeader SkillResponse
type CarouselType ¶
type CarouselType struct { Type string `json:"type"` // BasicCardType, CommerceCard Items []interface{} `json:"items"` Header CarouselHeaderType `json:"header,omitempty"` }
CarouselType is Carousel template
func Carousel ¶
func Carousel(Type string, items []interface{}, header CarouselHeaderType) CarouselType
Carousel creates Carousel SkillResponse
type CommerceCardType ¶
type CommerceCardType struct { CommerceCard struct { Description string `json:"description"` Price int `json:"price"` Currency string `json:"currency"` Discount int `json:"discount,omitempty"` DiscountRate int `json:"discountRate,omitempty"` DiscountedPrice int `json:"dicountedPrice,omitempty"` Thumbnails []ThumbnailType `json:"thumbnails"` Profile ProfileType `json:"profile,omitempty"` Buttons []ButtonType `json:"buttons"` } `json:"commerceCard"` }
CommerceCardType is CommerceCard template
func CommerceCard ¶
func CommerceCard( description string, price int, currency string, discount int, discountRate int, discountedPrice int, thumbnails []ThumbnailType, profile ProfileType, buttons []ButtonType, ) CommerceCardType
CommerceCard creates CommerceCard SkillResponse
type ContextControl ¶
type ContextControl struct { Values []struct { Name string `json:"name"` LifeSpan int `json:"lifeSpan"` Params map[string]string `json:"params,omitempty"` } }
ContextControl is context of message
type LinkType ¶
type LinkType struct { PC string `json:"pc,omitempty"` Mobile string `json:"mobile,omitempty"` Web string `json:"web,omitempty"` }
LinkType is Link template
type ListCardType ¶
type ListCardType struct { ListCard struct { Header ListItemType `json:"header"` Items []ListItemType `json:"items"` Buttons []ButtonType `json:"buttons,omitempty"` } `json:"listCard"` }
ListCardType is ListCard template
func ListCard ¶
func ListCard(header ListItemType, items []ListItemType, buttons []ButtonType) ListCardType
ListCard creates ListCard SkillResponse
type ListItemType ¶
type ListItemType struct { Title string `json:"title"` Description string `json:"description,omitempty"` ImageURL string `json:"imageUrl,omitempty"` Link LinkType `json:"link,omitempty"` }
ListItemType is ListItem template
type ProfileType ¶
ProfileType is Profile template
func Profile ¶
func Profile(nickname string, imageURL string) ProfileType
Profile creates Profile SkillResponse
type QuickRepliesType ¶
type QuickRepliesType struct { Label string `json:"label"` Action string `json:"action"` MessageText string `json:"messageText,omitempty"` BlockID string `json:"blockId,omitempty"` Extra interface{} `json:"extra,omitempty"` }
QuickRepliesType is QucikReplies Template
func QuickReplies ¶
func QuickReplies(label string, action string, messageText string, blockID string, extra interface{}) QuickRepliesType
QuickReplies creates QuickReplies SkillResponse
type SimpleImageType ¶
type SimpleImageType struct { SimpleImage struct { ImageURL string `json:"imageUrl"` AltText string `json:"altText"` } `json:"simpleImage"` }
SimpleImageType is SimpleImage Template which located in SkillTemplate.Outputs
func SimpleImage ¶
func SimpleImage(imageURL string, altText string) SimpleImageType
SimpleImage creates SimpleImage SkillResponse
type SimpleTextType ¶
type SimpleTextType struct { SimpleText struct { Text string `json:"text"` } `json:"simpleText"` }
SimpleTextType is SimpleText Template which located in SkillTemplate.Outputs
func SimpleText ¶
func SimpleText(text string) SimpleTextType
SimpleText creates SimpleTextType SkillResponse
type SkillPayload ¶
type SkillPayload struct { UserRequest struct { Timezone string `json:"timezone"` Params map[string]interface{} `json:"params"` Block struct { ID string `json:"id"` Name string `json:"name"` } `json:"block"` Utterance string `json:"utterance"` Lang string `json:"lang"` User struct { ID string `json:"id"` Type string `json:"type"` Properties struct { PlusfriendUserKey string `json:"plusfriendUserKey"` } `json:"properties"` } `json:"user"` } `json:"userRequest"` Contexts []interface{} `json:"contexts"` Bot struct { ID string `json:"id"` Name string `json:"name"` } `json:"bot"` Action struct { Name string `json:"name"` ClientExtra map[string]string `json:"clientExtra"` Params struct { } `json:"params"` ID string `json:"id"` DetailParams struct { } `json:"detailParams"` } `json:"action"` }
SkillPayload is the payload which was passed by kakao i open builder server
type SkillResponse ¶
type SkillResponse struct { Version string `json:"version"` Template SkillTemplate `json:"template,omitempty"` Context interface{} `json:"context,omitempty"` Data interface{} `json:"data,omitempty"` }
SkillResponse is the response which pass to kakao i open builder server
type SkillTemplate ¶
type SkillTemplate struct { Outputs []interface{} `json:"outputs,omitempty"` QuickReplies []QuickRepliesType `json:"quickReplies,omitempty"` }
SkillTemplate is the template which represents a message
type ThumbnailType ¶
type ThumbnailType struct { ImageURL string `json:"imageUrl"` Link LinkType `json:"link,omitempty"` FixedRatio bool `json:"fixedRatio,omitempty"` Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` }
ThumbnailType is Thumbnail template which located in CarouselHeaderType