Documentation ¶
Overview ¶
Package server implements an object store server
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStoreServer ¶
func NewStoreServer(config StoreServerConfig) http.Handler
NewStoreServer returns a StoreServer backed by a file object store
Types ¶
type StoreServer ¶
type StoreServer struct {
// contains filtered or unexported fields
}
StoreServer implements an http server that handles object store requests
func (*StoreServer) Download ¶
func (s *StoreServer) Download(w http.ResponseWriter, r *http.Request)
Download returns an object's content given its id
func (*StoreServer) Get ¶
func (s *StoreServer) Get(w http.ResponseWriter, r *http.Request)
Get retrieves an objects if exists in the object store or an error otherwise
func (*StoreServer) Store ¶
func (s *StoreServer) Store(w http.ResponseWriter, r *http.Request)
Store stores the object and returns the metadata
type StoreServerConfig ¶
type StoreServerConfig struct { BaseURL string Store store.ObjectStore Log *slog.Logger }
StoreServerConfig defines the configuration for the APIServer
Click to show internal directories.
Click to hide internal directories.