Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchValidationResult ¶ added in v1.0.0
type FetchValidator ¶ added in v1.0.0
type FetchValidator interface {
ValidateResponse(context.Context, tldb.Adapter, string, request.FetchResponse) (FetchValidationResult, error)
}
type Options ¶
type Options struct {
FeedURL string
FeedID int
URLType string
Storage string
AllowFTPFetch bool
AllowLocalFetch bool
AllowS3Fetch bool
MaxSize uint64
HideURL bool
FetchedAt time.Time
Secrets []dmfr.Secret
}
Options sets options for a fetch operation.
type RTFetchOptions ¶ added in v1.0.0
type RTFetchOptions struct {
Options
}
type RTFetchResult ¶
type RTFetchResult struct {
Message *pb.FeedMessage
Result
}
func RTFetch ¶
func RTFetch(ctx context.Context, atx tldb.Adapter, opts RTFetchOptions) (RTFetchResult, error)
type RTFetchValidator ¶ added in v1.0.0
type RTFetchValidator struct {
Result RTFetchResult
RTFetchOptions RTFetchOptions
}
func NewRTFetchValidator ¶ added in v1.0.0
func NewRTFetchValidator(opts RTFetchOptions) *RTFetchValidator
func (*RTFetchValidator) Fetch ¶ added in v1.0.0
func (r *RTFetchValidator) Fetch(ctx context.Context, atx tldb.Adapter) (RTFetchResult, error)
func (*RTFetchValidator) ValidateResponse ¶ added in v1.0.0
func (r *RTFetchValidator) ValidateResponse(ctx context.Context, atx tldb.Adapter, fn string, fr request.FetchResponse) (FetchValidationResult, error)
type Result ¶
type Result struct {
Found bool
Error error
URL string
ResponseSize int
ResponseCode int
ResponseTtfbMs int
ResponseTimeMs int
ResponseSHA1 string
FetchError error
FeedVersionID tt.Int
}
Result contains results of a fetch operation.
type StaticFetchOptions ¶ added in v1.0.0
type StaticFetchResult ¶
type StaticFetchResult struct {
FeedVersion *dmfr.FeedVersion
FeedVersionValidatorResult *validator.Result
Result
}
func StaticFetch ¶
func StaticFetch(ctx context.Context, atx tldb.Adapter, opts StaticFetchOptions) (StaticFetchResult, error)
StaticFetch from a URL. Creates FeedVersion and FeedFetch records. Returns an error if a serious failure occurs, such as database or filesystem access. Sets Result.FetchError if a regular failure occurs, such as a 404.
type StaticFetchValidator ¶ added in v1.0.0
type StaticFetchValidator struct {
FeedVersion *dmfr.FeedVersion
FeedVersionValidatorResult *validator.Result
StaticFetchOptions StaticFetchOptions
}
func NewStaticFetchValidator ¶ added in v1.0.0
func NewStaticFetchValidator(opts StaticFetchOptions) *StaticFetchValidator
func (*StaticFetchValidator) Fetch ¶ added in v1.0.0
func (sfv *StaticFetchValidator) Fetch(ctx context.Context, atx tldb.Adapter) (StaticFetchResult, error)
func (*StaticFetchValidator) ValidateResponse ¶ added in v1.0.0
func (sfv *StaticFetchValidator) ValidateResponse(ctx context.Context, atx tldb.Adapter, fn string, fetchResponse request.FetchResponse) (FetchValidationResult, error)
Click to show internal directories.
Click to hide internal directories.