Files
herolib/lib/core/httpconnection/connection.v
2025-10-12 12:30:19 +03:00

22 lines
500 B
V

module httpconnection
import net.http { Header }
import incubaid.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)
}