webhook

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebhookSendStatusFailed  string = "failed"
	WebhookSendStatusSuccess string = "success"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IWebHook

type IWebHook interface {
	Run(ctx context.Context)
	Send(message *Message, dbTx pgx.Tx) error
	ProcessPlainMessage(ctx context.Context, dto PreparedHookDto) error
	SendWebhook(ctx context.Context, url string, payload []byte, sign string) (Result, error)
	GetHistory(ctx context.Context, user models.User, storeUUIDs []uuid.UUID, page, pageSize *uint32) (*storecmn.FindResponseWithPagingFlag[*repo_webhook_send_histories.FindRow], error)
}

type Message

type Message struct {
	TxID      uuid.UUID `json:"tx_id"`
	WebhookID uuid.UUID `json:"webhook_id"`
	Type      string    `json:"type"`
	Data      []byte    `json:"data"`
	Delay     int16     `json:"delay"`
	Signature string    `json:"signature"`
}

type PreparedHookDto

type PreparedHookDto struct {
	ID            uuid.NullUUID
	TransactionID uuid.UUID
	StoreID       uuid.UUID
	IsManual      bool
	Event         string
	Payload       []byte
	Signature     string
	URL           string
	RetriesCount  int64
}

type Result

type Result struct {
	Status             string
	Response           string
	Request            string
	ResponseStatusCode int
}

type StoreWhResponse

type StoreWhResponse struct {
	Success bool `json:"success"`
}

Jump to

Keyboard shortcuts

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