Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( MessageResponsePool *sync.Pool MessageResponseItemPool *sync.Pool )
var ErrorResponsePool *sync.Pool
var MessagePayloadPool *sync.Pool
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (err *ErrorResponse) Error() string
func (*ErrorResponse) MarshalJSONObject ¶
func (r *ErrorResponse) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements MarshalerJSONObject
func (*ErrorResponse) NKeys ¶
func (r *ErrorResponse) NKeys() int
NKeys returns the number of keys to unmarshal
func (*ErrorResponse) UnmarshalJSONObject ¶
func (r *ErrorResponse) UnmarshalJSONObject(dec *gojay.Decoder, k string) error
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
type FileResponse ¶
type FileResponse struct { Id string `json:"id"` Created int `json:"created"` Timestamp int `json:"timestamp"` Name string `json:"name"` Title string `json:"title"` Mimetype string `json:"mimetype"` Filetype string `json:"filetype"` PrettyType string `json:"pretty_type"` User string `json:"user"` Editable bool `json:"editable"` Size int `json:"size"` Mode string `json:"mode"` IsExternal bool `json:"is_external"` ExternalType string `json:"external_type"` IsPublic bool `json:"is_public"` DisplayAsBot bool `json:"display_as_bot"` Username string `json:"username"` UrlPrivate string `json:"url_private"` UrlPrivateDownload string `json:"url_private_download"` Thumb64 string `json:"thumb_64"` Thumb80 string `json:"thumb_80"` Thumb360 string `json:"thumb_360"` Thumb360W int `json:"thumb_360_w"` Thumb360H int `json:"thumb_360_h"` Thumb480 string `json:"thumb_480"` Thumb480W int `json:"thumb_480_w"` Thumb480H int `json:"thumb_480_h"` Thumb160 string `json:"thumb_160"` ImageExifRotation int `json:"image_exif_rotation"` OriginalW int `json:"original_w"` OriginalH int `json:"original_h"` Permalink string `json:"permalink"` PermalinkPublic string `json:"permalink_public"` CommentsCount int `json:"comments_count"` IsStarred bool `json:"is_starred"` Channels []string `json:"channels"` Groups []string `json:"groups"` Ims []string `json:"ims"` HasRichPreview bool `json:"has_rich_preview"` }
type FileShares ¶
type FileShares struct {}
type FileThread ¶
type FilesUploadPayload ¶
type FilesUploadResponse ¶
type FilesUploadResponse struct { Ok bool `json:"ok"` File FileResponse `json:"file"` }
func FileUpload ¶
func FileUpload(ctx context.Context, client Client, payload FilesUploadPayload) (resp FilesUploadResponse, err error)
FileUpload uploads file to slack.
type MessageParseOption ¶
type MessageParseOption string
type MessagePayload ¶
type MessagePayload struct { Channel string `json:"channel"` Text string `json:"text"` Blocks block.Blocks `json:"blocks"` Attachments []gojay.MarshalerJSONObject `json:"attachments"` AsUser bool `json:"as_user"` IconEmoji string `json:"icon_emoji"` IconURL string `json:"icon_url"` LinkNames bool `json:"link_names"` Metadata gojay.MarshalerJSONArray `json:"metadata"` Mrkdwn bool `json:"mrkdwn"` Parse MessageParseOption `json:"parse"` ReplyBroadcast bool `json:"reply_broadcast"` ThreadTS string `json:"thread_ts"` UnfurlLinks bool `json:"unfurl_links"` UnfurlMedia bool `json:"unfurl_media"` Username string `json:"username"` }
See https://api.slack.com/methods/chat.postMessage for details.
func (MessagePayload) IsNil ¶
func (m MessagePayload) IsNil() bool
func (MessagePayload) MarshalJSONObject ¶
func (m MessagePayload) MarshalJSONObject(enc *gojay.Encoder)
func (*MessagePayload) Reset ¶
func (m *MessagePayload) Reset()
type MessageResponse ¶
type MessageResponse struct { Ok bool `json:"ok"` Channel string `json:"channel"` Ts string `json:"ts"` Message MessageResponseItem `json:"message"` }
func PostMessage ¶
func PostMessage(ctx context.Context, client Client, token string, payload *MessagePayload) (resp *MessageResponse, err error)
PostMessage Posts Message to Slack. This is not for messages with file attachments.
func (*MessageResponse) IsNil ¶
func (r *MessageResponse) IsNil() bool
IsNil checks if instance is nil
func (*MessageResponse) MarshalJSONObject ¶
func (r *MessageResponse) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements MarshalerJSONObject
func (*MessageResponse) NKeys ¶
func (r *MessageResponse) NKeys() int
NKeys returns the number of keys to unmarshal
func (*MessageResponse) Release ¶
func (i *MessageResponse) Release()
func (*MessageResponse) UnmarshalJSONObject ¶
func (r *MessageResponse) UnmarshalJSONObject(dec *gojay.Decoder, k string) error
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
type MessageResponseItem ¶
type MessageResponseItem struct { Text string `json:"text"` Username string `json:"username"` BotID string `json:"bot_id"` Attachments json.RawMessage `json:"attachments"` Type string `json:"type"` Subtype string `json:"subtype"` Ts string `json:"ts"` }
func (*MessageResponseItem) IsNil ¶
func (i *MessageResponseItem) IsNil() bool
IsNil checks if instance is nil
func (*MessageResponseItem) MarshalJSONObject ¶
func (i *MessageResponseItem) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject implements MarshalerJSONObject
func (*MessageResponseItem) NKeys ¶
func (i *MessageResponseItem) NKeys() int
NKeys returns the number of keys to unmarshal
func (*MessageResponseItem) UnmarshalJSONObject ¶
func (i *MessageResponseItem) UnmarshalJSONObject(dec *gojay.Decoder, k string) error
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject