webhook

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Post

func Post(payload WebhookPayload) error

Post posts the message to webhook endpoint.

Types

type Memo

type Memo struct {
	ID        int32 `json:"id"`
	CreatorID int32 `json:"creatorId"`
	CreatedTs int64 `json:"createdTs"`
	UpdatedTs int64 `json:"updatedTs"`

	// Domain specific fields
	Content      string          `json:"content"`
	Visibility   string          `json:"visibility"`
	Pinned       bool            `json:"pinned"`
	ResourceList []*Resource     `json:"resourceList"`
	RelationList []*MemoRelation `json:"relationList"`
}

type MemoRelation

type MemoRelation struct {
	MemoID        int32  `json:"memoId"`
	RelatedMemoID int32  `json:"relatedMemoId"`
	Type          string `json:"type"`
}

type Resource

type Resource struct {
	ID int32 `json:"id"`

	// Standard fields
	CreatorID int32 `json:"creatorId"`
	CreatedTs int64 `json:"createdTs"`
	UpdatedTs int64 `json:"updatedTs"`

	// Domain specific fields
	Filename     string `json:"filename"`
	InternalPath string `json:"internalPath"`
	ExternalLink string `json:"externalLink"`
	Type         string `json:"type"`
	Size         int64  `json:"size"`
}

type WebhookPayload

type WebhookPayload struct {
	URL          string `json:"url"`
	ActivityType string `json:"activityType"`
	CreatorID    int32  `json:"creatorId"`
	CreatedTs    int64  `json:"createdTs"`
	Memo         *Memo  `json:"memo"`
}

WebhookPayload is the payload of webhook request. nolint

type WebhookResponse

type WebhookResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

WebhookResponse is the response of webhook request. nolint

Jump to

Keyboard shortcuts

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