Documentation ¶
Index ¶
- func DownloadAndVerifyFileSync(ctx context.Context, verifyFunc DownloadVerifier, auditor DownloadAuditor, ...) (bool, error)
- func DownloadFileSync(ctx context.Context, crlUrl url.URL, path string, maxRetries uint, ...) error
- func GetSizeAndDateOfFile(path string) (int64, time.Time, error)
- type DownloadAction
- type DownloadAuditor
- type DownloadIdentifier
- type DownloadTracer
- type DownloadVerifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAndVerifyFileSync ¶
func DownloadAndVerifyFileSync(ctx context.Context, verifyFunc DownloadVerifier, auditor DownloadAuditor, identifier DownloadIdentifier, crlUrl url.URL, finalPath string, maxRetries uint, timeout time.Duration) (bool, error)
* Returns: Boolean of whether the data at finalPath is now valid, and any error. It is possible * that err != nil and yet finalPath is valid, so callers should rely on the boolean and merely * log the error as needed.
func DownloadFileSync ¶
Types ¶
type DownloadAction ¶
type DownloadAction int
const ( Create DownloadAction = 0 Resume DownloadAction = 1 UpToDate DownloadAction = 2 )
type DownloadAuditor ¶
type DownloadAuditor interface { FailedDownload(identifier DownloadIdentifier, crlUrl *url.URL, dlTracer *DownloadTracer, err error) FailedVerifyUrl(identifier DownloadIdentifier, crlUrl *url.URL, dlTracer *DownloadTracer, err error) FailedVerifyPath(identifier DownloadIdentifier, crlUrl *url.URL, crlPath string, err error) }
type DownloadIdentifier ¶
type DownloadIdentifier interface {
ID() string
}
type DownloadTracer ¶
type DownloadTracer struct {
DNSDone []httptrace.DNSDoneInfo
}
func NewDownloadTracer ¶
func NewDownloadTracer() *DownloadTracer
func (*DownloadTracer) Configure ¶
func (da *DownloadTracer) Configure(ctx context.Context) context.Context
func (*DownloadTracer) DNSResults ¶
func (da *DownloadTracer) DNSResults() []string
func (*DownloadTracer) Errors ¶
func (da *DownloadTracer) Errors() []string
type DownloadVerifier ¶
Click to show internal directories.
Click to hide internal directories.