aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2022-01-08 20:08:36 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2022-01-08 20:08:36 +0100
commit5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e (patch)
tree130f59f0b659f9e23d6cd79a5dbc54e7910ae0b7 /internal/feed/feed.go
parent180aa45d40e5d58d579fcaba44b94bcb8e3e08be (diff)
downloadfeed2imap-go-5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e.tar.gz
feed2imap-go-5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e.tar.bz2
feed2imap-go-5c5ea3caa6770c89c9c3b8e8be6916e74e29f27e.zip
Introduce http.Context to bundle http specific parameters
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r--internal/feed/feed.go8
1 files changed, 8 insertions, 0 deletions
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 != "" {