Documentation
¶
Index ¶
- Variables
- func GetEventTypeByPath(path string) func(data EventTypeParam) string
- func GetPrimaryKeyByPath(path string) func(parsedData gjson.Result) entities.PkFields
- func SetupService[T Authentication](ctx context.Context, router *swagger.Router[fiber.Handler, fiber.Router], ...) error
- type Authentication
- type Configuration
- type ContentTypeConfig
- type Event
- type EventTypeParam
- type Events
- type RequestInfo
- type ValidatingRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWebhookPathRequired = errors.New("webhook path is required") ErrSupportedEventsRequired = errors.New("supported events are required") ErrInvalidWebhookAuthenticationConfig = errors.New("invalid webhook authentication configuration") ErrMissingRequest = errors.New("missing request for webhook authentication check") )
View Source
var ( ErrUnmarshalEvent = errors.New("error unmarshaling event") ErrUnsupportedWebhookEvent = errors.New("unsupported webhook event") ErrUnsupportedContentType = errors.New("unsupported content type for webhook request") ErrFailedToParseContentType = errors.New("failed to parse content type") ErrFailsToParseBody = errors.New("failed to parse body") )
View Source
var (
ErrMissingFieldID = errors.New("missing id field in event")
)
Functions ¶
func GetEventTypeByPath ¶ added in v0.3.0
func GetEventTypeByPath(path string) func(data EventTypeParam) string
func GetPrimaryKeyByPath ¶ added in v0.2.0
func SetupService ¶
func SetupService[T Authentication]( ctx context.Context, router *swagger.Router[fiber.Handler, fiber.Router], config Configuration[T], p pipeline.IPipelineGroup, ) error
Types ¶
type Authentication ¶
type Authentication interface { CheckSignature(req ValidatingRequest) error Validate() error }
type Configuration ¶
type Configuration[T Authentication] struct { // Secret the webhook secret configuration for validating the data received Authentication T `json:"authentication"` WebhookPath string `json:"webhookPath"` Events *Events `json:"-"` }
func (*Configuration[T]) CheckSignature ¶ added in v0.2.0
func (c *Configuration[T]) CheckSignature(req ValidatingRequest) error
func (*Configuration[T]) Validate ¶
func (c *Configuration[T]) Validate() error
type ContentTypeConfig ¶ added in v0.3.0
ContentTypeConfig allows configuring how to extract the payload field for a given content-type
type EventTypeParam ¶ added in v0.3.0
type Events ¶
type Events struct { Supported map[string]Event GetEventType func(data EventTypeParam) string PayloadKey ContentTypeConfig }
type RequestInfo ¶ added in v0.3.0
type RequestInfo struct {
// contains filtered or unexported fields
}
type ValidatingRequest ¶
Click to show internal directories.
Click to hide internal directories.