vegvisir/pkg/cache/response.go
Piotr Biernat d651571a55
Some checks failed
continuous-integration/drone/push Build is failing
tmp goroutines cache
2021-11-12 20:11:56 +01:00

37 lines
938 B
Go

// ___ ____ ___ ___
// \ \ / / | _ | __| \ \ / / || | __ || || _ |
// \ \/ / |___ | |__ \ \/ / || |___ || ||___|
// \ / | _ | _ | \ / || __ | || ||\\
// \/ |___ |___ | \/ || ____| || || \\
//
// Copyright (c) 2021 Piotr Biernat. https://pbiernat.dev. MIT License
// Repo: https://git.pbiernat.dev/golang/vegvisir
package cache
import "github.com/valyala/fasthttp"
// Headers type
type Headers map[string]string
// ResponseCache struct
type ResponseCache struct {
URL string
Method string
Body string
Code int
Headers *fasthttp.ResponseHeader
}
func NewResponseCache(url, method, body string, code int, headers *fasthttp.ResponseHeader) *ResponseCache {
return &ResponseCache{url, method, body, code, headers}
}
//func (r *ResponseCache) StatusCode() int {
// return r.Code
//}
//
//func (r *ResponseCache) Body() []byte {
// return r.Body
//}