traefik/vendor/github.com/xenolf/lego/challenge/provider.go

29 lines
1 KiB
Go
Raw Normal View History

2019-01-07 17:30:06 +00:00
package challenge
2018-03-26 12:12:03 +00:00
import "time"
2019-01-07 17:30:06 +00:00
// Provider enables implementing a custom challenge
2018-03-26 12:12:03 +00:00
// provider. Present presents the solution to a challenge available to
// be solved. CleanUp will be called by the challenge if Present ends
// in a non-error state.
2019-01-07 17:30:06 +00:00
type Provider interface {
2018-03-26 12:12:03 +00:00
Present(domain, token, keyAuth string) error
CleanUp(domain, token, keyAuth string) error
}
2019-01-07 17:30:06 +00:00
// ProviderTimeout allows for implementing a
// Provider where an unusually long timeout is required when
2018-03-26 12:12:03 +00:00
// waiting for an ACME challenge to be satisfied, such as when
2019-01-07 17:30:06 +00:00
// checking for DNS record propagation. If an implementor of a
// Provider provides a Timeout method, then the return values
2018-03-26 12:12:03 +00:00
// of the Timeout method will be used when appropriate by the acme
// package. The interval value is the time between checks.
//
// The default values used for timeout and interval are 60 seconds and
// 2 seconds respectively. These are used when no Timeout method is
2019-01-07 17:30:06 +00:00
// defined for the Provider.
type ProviderTimeout interface {
Provider
2018-03-26 12:12:03 +00:00
Timeout() (timeout, interval time.Duration)
}