Files
herolib/lib/core/httpconnection/connection.v
2024-12-25 19:17:23 +01:00

22 lines
508 B
V

module httpconnection
import net.http { Header }
import freeflowuniverse.herolib.core.redisclient { Redis }
@[heap]
pub struct HTTPConnection {
pub mut:
redis Redis @[str: skip]
base_url string // the base url
default_header Header
cache CacheConfig
retry int = 5
}
// Join headers from httpconnection and Request
fn (mut h HTTPConnection) header(req Request) Header {
mut header := req.header or { return h.default_header }
return h.default_header.join(header)
}