Documentation ¶
Index ¶
- Constants
- Variables
- func Apply(url, data, placeholder string, config PlaceholderConfig, ...) (types.Request, error)
- func RandomHex(n int) (string, error)
- type BadPlaceholderConfigError
- type GRPC
- type GraphQL
- type GraphQLConfig
- type HTMLForm
- type HTMLMultipartForm
- type Header
- type JSONBody
- type JSONRequest
- type Placeholder
- type PlaceholderConfig
- type RawRequest
- type RawRequestConfig
- type RequestBody
- type SOAPBody
- type URLParam
- type URLPath
- type UnknownPlaceholderError
- type UserAgent
- type XMLBody
Constants ¶
View Source
const (
Seed = 5
)
View Source
const UAHeader = "User-Agent"
Variables ¶
View Source
var DefaultGRPC = &GRPC{name: "gRPC"}
View Source
var DefaultGraphQL = &GraphQL{name: "GraphQL"}
View Source
var DefaultHTMLForm = &HTMLForm{name: "HTMLForm"}
View Source
var DefaultHTMLMultipartForm = &HTMLMultipartForm{name: "HTMLMultipartForm"}
View Source
var DefaultHeader = &Header{name: "Header"}
View Source
var DefaultJSONBody = &JSONBody{name: "JSONBody"}
View Source
var DefaultJSONRequest = &JSONRequest{name: "JSONRequest"}
View Source
var DefaultRawRequest = &RawRequest{name: "RawRequest"}
View Source
var DefaultRequestBody = &RequestBody{name: "RequestBody"}
View Source
var DefaultSOAPBody = &SOAPBody{name: "SOAPBody"}
View Source
var DefaultURLParam = &URLParam{name: "URLParam"}
View Source
var DefaultURLPath = &URLPath{name: "URLPath"}
View Source
var DefaultUserAgent = &UserAgent{name: "UserAgent"}
View Source
var DefaultXMLBody = &XMLBody{name: "XMLBody"}
View Source
var Placeholders map[string]Placeholder
Functions ¶
func Apply ¶
func Apply( url, data, placeholder string, config PlaceholderConfig, httpClientType types.HTTPClientType, ) (types.Request, error)
Types ¶
type BadPlaceholderConfigError ¶ added in v0.4.4
type BadPlaceholderConfigError struct {
// contains filtered or unexported fields
}
func (*BadPlaceholderConfigError) Error ¶ added in v0.4.4
func (e *BadPlaceholderConfigError) Error() string
func (*BadPlaceholderConfigError) Unwrap ¶ added in v0.4.4
func (e *BadPlaceholderConfigError) Unwrap() error
type GRPC ¶ added in v0.4.0
type GRPC struct {
// contains filtered or unexported fields
}
func (*GRPC) CreateRequest ¶ added in v0.4.0
func (p *GRPC) CreateRequest(string, string, PlaceholderConfig, types.HTTPClientType) (types.Request, error)
func (*GRPC) NewPlaceholderConfig ¶ added in v0.5.0
func (p *GRPC) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type GraphQL ¶ added in v0.5.1
type GraphQL struct {
// contains filtered or unexported fields
}
func (*GraphQL) CreateRequest ¶ added in v0.5.1
func (p *GraphQL) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*GraphQL) NewPlaceholderConfig ¶ added in v0.5.1
func (p *GraphQL) NewPlaceholderConfig(conf map[any]any) (PlaceholderConfig, error)
type GraphQLConfig ¶ added in v0.5.1
type GraphQLConfig struct {
Method string
}
func (*GraphQLConfig) Hash ¶ added in v0.5.1
func (g *GraphQLConfig) Hash() []byte
type HTMLForm ¶ added in v0.4.0
type HTMLForm struct {
// contains filtered or unexported fields
}
func (*HTMLForm) CreateRequest ¶ added in v0.4.0
func (p *HTMLForm) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*HTMLForm) NewPlaceholderConfig ¶ added in v0.5.0
func (p *HTMLForm) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type HTMLMultipartForm ¶ added in v0.4.0
type HTMLMultipartForm struct {
// contains filtered or unexported fields
}
func (*HTMLMultipartForm) CreateRequest ¶ added in v0.4.0
func (p *HTMLMultipartForm) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*HTMLMultipartForm) GetName ¶ added in v0.4.0
func (p *HTMLMultipartForm) GetName() string
func (*HTMLMultipartForm) NewPlaceholderConfig ¶ added in v0.5.0
func (p *HTMLMultipartForm) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
func (*Header) CreateRequest ¶ added in v0.4.0
func (p *Header) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*Header) NewPlaceholderConfig ¶ added in v0.5.0
func (p *Header) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type JSONBody ¶
type JSONBody struct {
// contains filtered or unexported fields
}
func (*JSONBody) CreateRequest ¶ added in v0.4.0
func (p *JSONBody) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*JSONBody) NewPlaceholderConfig ¶ added in v0.5.0
func (p *JSONBody) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type JSONRequest ¶ added in v0.4.0
type JSONRequest struct {
// contains filtered or unexported fields
}
func (*JSONRequest) CreateRequest ¶ added in v0.4.0
func (p *JSONRequest) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*JSONRequest) GetName ¶ added in v0.4.0
func (p *JSONRequest) GetName() string
func (*JSONRequest) NewPlaceholderConfig ¶ added in v0.5.0
func (p *JSONRequest) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type Placeholder ¶
type Placeholder interface { NewPlaceholderConfig(conf map[any]any) (PlaceholderConfig, error) GetName() string CreateRequest( requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType, ) (types.Request, error) }
type PlaceholderConfig ¶ added in v0.4.12
func GetPlaceholderConfig ¶ added in v0.4.4
func GetPlaceholderConfig(name string, conf any) (PlaceholderConfig, error)
type RawRequest ¶ added in v0.4.4
type RawRequest struct {
// contains filtered or unexported fields
}
func (*RawRequest) CreateRequest ¶ added in v0.4.4
func (p *RawRequest) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
CreateRequest creates a new request from config. config must be a RawRequestConfig struct.
func (*RawRequest) GetName ¶ added in v0.4.4
func (p *RawRequest) GetName() string
func (*RawRequest) NewPlaceholderConfig ¶ added in v0.5.0
func (p *RawRequest) NewPlaceholderConfig(conf map[any]any) (PlaceholderConfig, error)
type RawRequestConfig ¶ added in v0.4.4
func (*RawRequestConfig) Hash ¶ added in v0.4.12
func (r *RawRequestConfig) Hash() []byte
type RequestBody ¶
type RequestBody struct {
// contains filtered or unexported fields
}
func (*RequestBody) CreateRequest ¶ added in v0.4.0
func (p *RequestBody) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*RequestBody) GetName ¶ added in v0.4.0
func (p *RequestBody) GetName() string
func (*RequestBody) NewPlaceholderConfig ¶ added in v0.5.0
func (p *RequestBody) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type SOAPBody ¶
type SOAPBody struct {
// contains filtered or unexported fields
}
func (*SOAPBody) CreateRequest ¶ added in v0.4.0
func (p *SOAPBody) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*SOAPBody) NewPlaceholderConfig ¶ added in v0.5.0
func (p *SOAPBody) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type URLParam ¶
type URLParam struct {
// contains filtered or unexported fields
}
func (*URLParam) CreateRequest ¶ added in v0.4.0
func (p *URLParam) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*URLParam) NewPlaceholderConfig ¶ added in v0.5.0
func (p *URLParam) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type URLPath ¶
type URLPath struct {
// contains filtered or unexported fields
}
func (*URLPath) CreateRequest ¶ added in v0.4.0
func (p *URLPath) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*URLPath) NewPlaceholderConfig ¶ added in v0.5.0
func (p *URLPath) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type UnknownPlaceholderError ¶ added in v0.4.3
type UnknownPlaceholderError struct {
// contains filtered or unexported fields
}
func (*UnknownPlaceholderError) Error ¶ added in v0.4.3
func (e *UnknownPlaceholderError) Error() string
type UserAgent ¶ added in v0.4.3
type UserAgent struct {
// contains filtered or unexported fields
}
func (*UserAgent) CreateRequest ¶ added in v0.4.3
func (p *UserAgent) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*UserAgent) NewPlaceholderConfig ¶ added in v0.5.0
func (p *UserAgent) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
type XMLBody ¶ added in v0.4.0
type XMLBody struct {
// contains filtered or unexported fields
}
func (*XMLBody) CreateRequest ¶ added in v0.4.0
func (p *XMLBody) CreateRequest(requestURL, payload string, config PlaceholderConfig, httpClientType types.HTTPClientType) (types.Request, error)
func (*XMLBody) NewPlaceholderConfig ¶ added in v0.5.0
func (p *XMLBody) NewPlaceholderConfig(map[any]any) (PlaceholderConfig, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.