Documentation ¶
Overview ¶
Package server implements a cache server
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidRequest = errors.New("invalid request") //nolint:revive
Functions ¶
func NewCacheServer ¶
func NewCacheServer(config CacheServerConfig) http.Handler
NewCacheServer returns a CacheServer backed by a cache
Types ¶
type CacheServer ¶
type CacheServer struct {
// contains filtered or unexported fields
}
CacheServer implements an http server that handles cache requests
func (*CacheServer) Download ¶
func (s *CacheServer) Download(w http.ResponseWriter, r *http.Request)
Download returns an object's content given its id
func (*CacheServer) Get ¶
func (s *CacheServer) Get(w http.ResponseWriter, r *http.Request)
Get retrieves an objects if exists in the cache or an error otherwise
func (*CacheServer) Store ¶
func (s *CacheServer) Store(w http.ResponseWriter, r *http.Request)
Store stores the object and returns the metadata
Click to show internal directories.
Click to hide internal directories.