2021-07-23 16:10:37 +02:00
|
|
|
// ___ ____ ___ ___
|
|
|
|
// \ \ / / | _ | __| \ \ / / || | __ || || _ |
|
|
|
|
// \ \/ / |___ | |__ \ \/ / || |___ || ||___|
|
|
|
|
// \ / | _ | _ | \ / || __ | || ||\\
|
|
|
|
// \/ |___ |___ | \/ || ____| || || \\
|
|
|
|
//
|
|
|
|
// Copyright (c) 2021 Piotr Biernat. https://pbiernat.dev. MIT License
|
|
|
|
// Repo: https://git.pbiernat.dev/golang/vegvisir
|
|
|
|
|
|
|
|
package cache
|
|
|
|
|
2021-11-10 01:36:33 +01:00
|
|
|
import "github.com/valyala/fasthttp"
|
2021-07-23 16:10:37 +02:00
|
|
|
|
2021-08-03 00:13:14 +02:00
|
|
|
// Headers type
|
2021-07-25 20:13:03 +02:00
|
|
|
type Headers map[string]string
|
|
|
|
|
2021-08-03 00:13:14 +02:00
|
|
|
// ResponseCache struct
|
2021-07-23 16:10:37 +02:00
|
|
|
type ResponseCache struct {
|
2021-07-25 20:13:03 +02:00
|
|
|
URL string
|
2021-11-10 01:36:33 +01:00
|
|
|
Method string
|
2021-07-25 20:13:03 +02:00
|
|
|
Body string
|
2021-11-10 01:36:33 +01:00
|
|
|
Code int
|
|
|
|
Headers *fasthttp.ResponseHeader
|
2021-07-23 16:10:37 +02:00
|
|
|
}
|
|
|
|
|
2021-11-15 21:41:38 +01:00
|
|
|
// NewResponseCache Creates new ResponseCache structure
|
2021-11-10 01:36:33 +01:00
|
|
|
func NewResponseCache(url, method, body string, code int, headers *fasthttp.ResponseHeader) *ResponseCache {
|
|
|
|
return &ResponseCache{url, method, body, code, headers}
|
2021-07-23 16:10:37 +02:00
|
|
|
}
|
|
|
|
|
2021-11-10 01:36:33 +01:00
|
|
|
//func (r *ResponseCache) StatusCode() int {
|
|
|
|
// return r.Code
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//func (r *ResponseCache) Body() []byte {
|
|
|
|
// return r.Body
|
|
|
|
//}
|