From 5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sat, 8 Jan 2022 20:08:36 +0100 Subject: Introduce http.Context to bundle http specific parameters --- internal/feed/feed.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/feed/feed.go') diff --git a/internal/feed/feed.go b/internal/feed/feed.go index 0741e8c..ffe831f 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -9,6 +9,7 @@ import ( "github.com/Necoro/gofeed" "github.com/Necoro/feed2imap-go/internal/feed/filter" + "github.com/Necoro/feed2imap-go/internal/http" "github.com/Necoro/feed2imap-go/pkg/config" "github.com/Necoro/feed2imap-go/pkg/log" ) @@ -33,6 +34,13 @@ type Descriptor struct { Url string } +func (feed *Feed) Context() http.Context { + return http.Context{ + Timeout: feed.Global.Timeout, + DisableTLS: feed.NoTLS, + } +} + func (feed *Feed) Descriptor() Descriptor { var url string if feed.Url != "" { -- cgit v1.2.3-70-g09d2