You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/vendor/github.com/exoscale/egoscale/v2/internal/public-api/request.go

21 lines
436 B

package publicapi
import (
"context"
"net/http"
)
// MultiRequestsEditor is an oapi-codegen compatible RequestEditorFn function that executes multiple
// RequestEditorFn functions sequentially.
func MultiRequestsEditor(fns ...RequestEditorFn) RequestEditorFn {
return func(ctx context.Context, req *http.Request) error {
for _, fn := range fns {
if err := fn(ctx, req); err != nil {
return err
}
}
return nil
}
}