Documentation ¶
Index ¶
- Constants
- Variables
- func V1ToV2WebhookAttachment(v1att Attachment) v2.Attachment
- func V1ToV2WebhookBody(v1msg GlipWebhookMessage) v2.GlipWebhookMessage
- func V1ToV2WewbhookUri(input string) string
- type Attachment
- type Author
- type Field
- type Footnote
- type GlipWebhookClient
- func (client *GlipWebhookClient) PostMessage(message GlipWebhookMessage) (*http.Response, error)
- func (client *GlipWebhookClient) PostMessageFast(message GlipWebhookMessage) (*fasthttp.Request, *fasthttp.Response, error)
- func (client *GlipWebhookClient) PostWebhook(url string, message GlipWebhookMessage) (*http.Response, error)
- func (client *GlipWebhookClient) PostWebhookFast(url string, message GlipWebhookMessage) (*fasthttp.Request, *fasthttp.Response, error)
- func (client *GlipWebhookClient) PostWebhookGUID(guid string, message GlipWebhookMessage) (*http.Response, error)
- func (client *GlipWebhookClient) PostWebhookGUIDFast(guidOrURL string, message GlipWebhookMessage) (*fasthttp.Request, *fasthttp.Response, error)
- func (client *GlipWebhookClient) PostWebhookV1Bytes(url string, message []byte) (*http.Response, error)
- func (client *GlipWebhookClient) PostWebhookV2(url string, message v2.GlipWebhookMessage) (*http.Response, error)
- type GlipWebhookError
- type GlipWebhookErrorResponse
- type GlipWebhookMessage
- type GlipWebhookResponse
Constants ¶
View Source
const ( ApiPathGlipFiles = "/restapi/v1.0/glip/files" ApiPathGlipGroups = "/restapi/v1.0/glip/groups" ApiPathGlipPosts = "/restapi/v1.0/glip/posts" GlipWebhookBaseURLProduction = "https://hooks.glip.com/webhook/" GlipWebhookBaseURLProductionV2 = "https://hooks.glip.com/webhook/v2/" GlipWebhookBaseURLSandbox = "https://hooks-glip.devtest.ringcentral.com/webhook/" GlipWebhookBaseURLSandboxV2 = "https://hooks-glip.devtest.ringcentral.com/webhook/v2/" AttachmentTypeCard = "Card" )
Variables ¶
View Source
var (
WebhookBaseURL string = "https://hooks.glip.com/webhook/"
)
Functions ¶
func V1ToV2WebhookAttachment ¶
func V1ToV2WebhookAttachment(v1att Attachment) v2.Attachment
func V1ToV2WebhookBody ¶
func V1ToV2WebhookBody(v1msg GlipWebhookMessage) v2.GlipWebhookMessage
func V1ToV2WewbhookUri ¶
Types ¶
type Attachment ¶
type Attachment struct { Type string `json:"card,omitempty"` Color string `json:"color,omitempty"` Pretext string `json:"pretext,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorLink string `json:"author_link,omitempty"` AuthorIcon string `json:"author_icon,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Fallback string `json:"fallback,omitempty"` Fields []Field `json:"fields,omitempty"` Text string `json:"text,omitempty"` ImageURL string `json:"image_url,omitempty"` ThumbnailURL string `json:"thumbnail_url,omitempty"` TS int64 `json:"ts,omitempty"` }
type GlipWebhookClient ¶
type GlipWebhookClient struct { HttpClient *http.Client FastClient fasthttp.Client WebhookUrl string // contains filtered or unexported fields }
func NewGlipWebhookClient ¶
func NewGlipWebhookClient(urlOrGuid string) (GlipWebhookClient, error)
func NewGlipWebhookClientFast ¶
func NewGlipWebhookClientFast(urlOrGuid string) (GlipWebhookClient, error)
func (*GlipWebhookClient) PostMessage ¶
func (client *GlipWebhookClient) PostMessage(message GlipWebhookMessage) (*http.Response, error)
func (*GlipWebhookClient) PostMessageFast ¶
func (client *GlipWebhookClient) PostMessageFast(message GlipWebhookMessage) (*fasthttp.Request, *fasthttp.Response, error)
Request using fasthttp Recycle request and response using fasthttp.ReleaseRequest(req) and fasthttp.ReleaseResponse(resp)
func (*GlipWebhookClient) PostWebhook ¶
func (client *GlipWebhookClient) PostWebhook(url string, message GlipWebhookMessage) (*http.Response, error)
func (*GlipWebhookClient) PostWebhookFast ¶
func (client *GlipWebhookClient) PostWebhookFast(url string, message GlipWebhookMessage) (*fasthttp.Request, *fasthttp.Response, error)
func (*GlipWebhookClient) PostWebhookGUID ¶
func (client *GlipWebhookClient) PostWebhookGUID(guid string, message GlipWebhookMessage) (*http.Response, error)
func (*GlipWebhookClient) PostWebhookGUIDFast ¶
func (client *GlipWebhookClient) PostWebhookGUIDFast(guidOrURL string, message GlipWebhookMessage) (*fasthttp.Request, *fasthttp.Response, error)
func (*GlipWebhookClient) PostWebhookV1Bytes ¶ added in v0.2.0
func (*GlipWebhookClient) PostWebhookV2 ¶
func (client *GlipWebhookClient) PostWebhookV2(url string, message v2.GlipWebhookMessage) (*http.Response, error)
type GlipWebhookError ¶
type GlipWebhookError struct { Code string `json:"code,omitempty"` Message string `json:"message,omitempty"` HttpStatusCode int `json:"http_status_code,omitempty"` ResponseData string `json:"response_data,omitempty"` Response GlipWebhookErrorResponse `json:"response,omitempty"` }
func (*GlipWebhookError) Inflate ¶
func (gwerr *GlipWebhookError) Inflate()
type GlipWebhookMessage ¶
type GlipWebhookMessage struct { Icon string `json:"icon,omitempty"` Activity string `json:"activity,omitempty"` Title string `json:"title,omitempty"` Body string `json:"body,omitempty"` AttachmentType string `json:"attachment_type,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` }
type GlipWebhookResponse ¶
type GlipWebhookResponse struct { Status string `json:"status,omitempty"` Message string `json:"message,omitempty"` Error GlipWebhookError `json:"error,omitempty"` }
Click to show internal directories.
Click to hide internal directories.