Documentation ¶
Index ¶
Constants ¶
View Source
const (
SkipGlobalValidateResponseCode = "ghem.download.skip.GlobalValidateResponseCode"
)
Variables ¶
View Source
var ( GlobalEvalResponsePlugins []EvalResponsePlugin ErrNoBody = errors.New("no body") )
View Source
var (
Client = http.DefaultClient
)
View Source
var ( GlobalBeforeEvalResponsePlugins = []BeforeEvalResponsePlugin{ GlobalValidateResponseCode(), } )
View Source
var (
GlobalBeforeRequestPlugins []BeforeRequestPlugin
)
Functions ¶
Types ¶
type BeforeEvalResponseFunc ¶
type BeforeEvalResponseFunc func(context.Context, *http.Response, *http.Request) (context.Context, *http.Response, error)
func (BeforeEvalResponseFunc) BeforeEvalResponse ¶
func (BeforeEvalResponseFunc) Self ¶
func (instance BeforeEvalResponseFunc) Self() Plugin
type BeforeEvalResponsePlugin ¶
type BeforeEvalResponsePlugin interface { Plugin BeforeEvalResponse(context.Context, *http.Response, *http.Request) (context.Context, *http.Response, error) }
func GlobalValidateResponseCode ¶
func GlobalValidateResponseCode() BeforeEvalResponsePlugin
type BeforeRequestFunc ¶
func (BeforeRequestFunc) BeforeRequest ¶
func (BeforeRequestFunc) Self ¶
func (instance BeforeRequestFunc) Self() Plugin
type BeforeRequestPlugin ¶
type BeforeRequestPlugin interface { Plugin BeforeRequest(context.Context, *http.Request) (context.Context, *http.Request, error) }
func BasicAuth ¶
func BasicAuth(user, password string) BeforeRequestPlugin
func BearerAuth ¶
func BearerAuth(token string) BeforeRequestPlugin
func Header ¶
func Header(name, value string) BeforeRequestPlugin
func Method ¶
func Method(method string) BeforeRequestPlugin
type EvalResponseFunc ¶
func EvalBody ¶
func EvalBody(onBody OnBody) EvalResponseFunc
func WriteTo ¶
func WriteTo(writer io.Writer) EvalResponseFunc
func WriteToFile ¶
func WriteToFile(filename string, perm os.FileMode) EvalResponseFunc
func WriteToTemporaryFile ¶
func WriteToTemporaryFile(dir, pattern string, onTempFile OnTempFile) EvalResponseFunc
func (EvalResponseFunc) EvalResponse ¶
func (EvalResponseFunc) Self ¶
func (instance EvalResponseFunc) Self() Plugin
type EvalResponsePlugin ¶
type OnTempFile ¶
Click to show internal directories.
Click to hide internal directories.