glipwebhook

package
v0.5.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GlipWebhookBaseURL = "https://hooks.glip.com/webhook/" // #nosec G101
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GlipWebhookClient

type GlipWebhookClient struct {
	HTTPClient *http.Client
	WebhookURL string
}

func NewGlipWebhookClient

func NewGlipWebhookClient(urlOrGUID string) (GlipWebhookClient, error)

func (*GlipWebhookClient) BuildWebhookURL

func (client *GlipWebhookClient) BuildWebhookURL(urlOrGUID string) (string, error)

func (*GlipWebhookClient) PostJSON

func (client *GlipWebhookClient) PostJSON(url string, bodyBytes []byte) (*http.Response, error)

func (*GlipWebhookClient) PostMessage

func (client *GlipWebhookClient) PostMessage(message GlipWebhookMessage) (*http.Response, error)

func (*GlipWebhookClient) SendMessage

func (client *GlipWebhookClient) SendMessage(message GlipWebhookMessage) ([]byte, 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 GlipWebhookErrorResponse

type GlipWebhookErrorResponse struct {
	Code       string `json:"code"`
	Message    string `json:"message"`
	Validation bool   `json:"validation"`
}

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"`
}

type GlipWebhookResponse

type GlipWebhookResponse struct {
	Status  string           `json:"status,omitempty"`
	Message string           `json:"message,omitempty"`
	Error   GlipWebhookError `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL