Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultSignatureHeader = "X-GoHooks-Verification"
)
Variables ¶
This section is empty.
Functions ¶
func InjectRequestContext ¶ added in v2.1.0
func IsGoHookValid ¶
IsGoHookValid checks the sha256 of the data matches the one given on the signature.
Types ¶
type GoHook ¶
type GoHook struct { // Data to be sent in the GoHook Payload GoHookPayload // The encrypted SHA resulting with the used salt ResultingSha string // Prepared JSON marshaled data PreparedData []byte // Choice of signature header to use on sending a GoHook SignatureHeader string // Should validate SSL certificate IsSecure bool // Preferred HTTP method to send the GoHook // Please choose only POST, DELETE, PATCH or PUT // Any other value will make the send use POST as fallback PreferredMethod string // Additional HTTP headers to be added to the hook AdditionalHeaders map[string]string // Span for distributed tracing Span *opentracing.Span // HTTP client Timeout in seconds (default 30) HTTPTimeout int64 // HTTPUserAgent HTTPUserAgent string }
GoHook represents the definition of a GoHook.
func (*GoHook) Create ¶
Create creates a webhook to be sent to another system, with a SHA 256 signature based on its contents.
func (*GoHook) CreateWithoutWrapper ¶
CreateCreateWithoutWrapper creates a webhook to be sent to another system, without wrapping it in a resource - data struct, with a SHA 256 signature based on its contents.
type GoHookPayload ¶
type GoHookPayload struct { Resource string `json:"resource"` Data interface{} `json:"data"` }
GoHookPayload represents the data that will be sent in the GoHook.
Click to show internal directories.
Click to hide internal directories.