cloudflared-mirror/vendor/github.com/equinox-io/equinox/sdk_ctx.go

30 lines
582 B
Go
Raw Permalink Normal View History

// +build go1.7
package equinox
import (
"context"
)
// CheckContext is like Check but includes a context.
func CheckContext(ctx context.Context, appID string, opts Options) (Response, error) {
var req, err = checkRequest(appID, &opts)
if err != nil {
return Response{}, err
}
return doCheckRequest(opts, req.WithContext(ctx))
}
// ApplyContext is like Apply but includes a context.
func (r Response) ApplyContext(ctx context.Context) error {
var req, opts, err = r.applyRequest()
if err != nil {
return err
}
return r.applyUpdate(req.WithContext(ctx), opts)
}