request

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRequest

func CreateRequest(ctx context.Context, params Parameters) (*http.Request, error)

Types

type BasicAuth

type BasicAuth struct {
	Username string `bson:"username" json:"username"`
	Password string `bson:"password" json:"password"`
}

type Parameters

type Parameters struct {
	URL        string                     `bson:"url" json:"url" binding:"required"`
	Method     string                     `bson:"method" json:"method" binding:"required,oneof=GET HEAD POST PUT PATCH DELETE CONNECT OPTIONS TRACE"`
	Auth       *BasicAuth                 `bson:"auth,omitempty" json:"auth"`
	Headers    map[string]string          `bson:"headers,omitempty" json:"headers"`
	Payload    string                     `bson:"payload,omitempty" json:"payload"`
	SkipVerify bool                       `bson:"skip_verify" json:"skip_verify"`
	Timeout    *datetime.DurationWithUnit `bson:"timeout,omitempty" json:"timeout"`
	RetryCount int64                      `bson:"retry_count,omitempty" json:"retry_count"`
	RetryDelay *datetime.DurationWithUnit `bson:"retry_delay,omitempty" json:"retry_delay"`
}

type ParsedParameters

type ParsedParameters struct {
	URL        template.ParsedTemplate
	Method     string
	Auth       *BasicAuth
	Headers    map[string]string
	Payload    template.ParsedTemplate
	SkipVerify bool
	Timeout    *datetime.DurationWithUnit
	RetryCount int64
	RetryDelay *datetime.DurationWithUnit
}

type WebhookDeclareTicket

type WebhookDeclareTicket struct {
	EmptyResponse bool              `bson:"empty_response" json:"empty_response"`
	IsRegexp      bool              `bson:"is_regexp" json:"is_regexp"`
	TicketID      string            `bson:"ticket_id,omitempty" json:"ticket_id"`
	TicketUrl     string            `bson:"ticket_url,omitempty" json:"ticket_url"`
	TicketUrlTpl  string            `bson:"ticket_url_tpl,omitempty" json:"ticket_url_tpl"`
	CustomFields  map[string]string `bson:",inline"`
}

func (WebhookDeclareTicket) MarshalJSON

func (t WebhookDeclareTicket) MarshalJSON() ([]byte, error)

func (*WebhookDeclareTicket) UnmarshalJSON

func (t *WebhookDeclareTicket) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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