server

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL