Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ForwardHttpClient = &http.Client{}
)
Functions ¶
func SetupAdministration ¶
func SetupAdministration(echoForWebhooks, echoForAdmin *echo.Echo, config ConfigStorage, reqStore RequestsStorage, path string)
func TransferHeaders ¶
Types ¶
type ConfigStorage ¶
type ForwardUrl ¶
type ForwardUrl struct { ID string `bson:"_id" json:"id"` Url string `bson:"url" json:"url" validate:"required"` KeepSuccessfulRequests int `bson:"keepSuccessfulRequests" json:"keepSuccessfulRequests"` Timeout time.Duration `bson:"timeout" json:"timeout" validate:"required"` ReturnAsResponse int `bson:"returnAsResponse" json:"returnAsResponse" validate:"required"` WaitTillCompletion int `bson:"waitTillCompletion" json:"waitForCompletion" validate:"required"` }
type Replay ¶
type Replay struct { RequestId string `bson:"requestId" json:"requestId" validate:"required"` WebhookId string `bson:"webhookId" json:"webhookId" validate:"required"` ForwardUrlId string `bson:"forwardUrlId" json:"forwardUrlId" validate:"required"` DeleteOnSuccess int `bson:"deleteOnSuccess" json:"deleteOnSuccess"` }
Replay is the set of information required to replay any request. It is not stored directly in the database but as a child/nested object.
type Request ¶
type Request struct { ID string `bson:"_id" json:"id"` Method string `bson:"method" json:"method"` Path string `bson:"path" json:"path"` Headers map[string][]string `bson:"headers" json:"headers"` Body string `bson:"body" json:"body"` ForwardUrl *ForwardUrl `bson:"forwardUrl" json:"forwardUrl"` FromWebhookId string `bson:"fromWebhookId" json:"fromWebhookId"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` ReplayPayload *Replay `bson:"replayPayload" json:"replayPayload"` }
type RequestsStorage ¶
type Webhook ¶
type Webhook struct { ID string `bson:"_id" json:"id"` Name string `bson:"name" json:"name" validate:"required"` Enabled int `bson:"enabled" json:"enabled"` Method string `bson:"method" json:"method" validate:"required"` Path string `bson:"path" json:"path" validate:"required"` ForwardUrls []*ForwardUrl `bson:"forwardUrls" json:"forwardUrls" validate:"required"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` }
func (*Webhook) RegisterWithEcho ¶
func (w *Webhook) RegisterWithEcho(e *echo.Echo, storage RequestsStorage) error
Click to show internal directories.
Click to hide internal directories.