Documentation ¶
Index ¶
- Variables
- type GCStats
- type Server
- func (s *Server) Checkout(ctx context.Context, checkout api.ShamanCheckout) (string, error)
- func (s *Server) Close()
- func (s *Server) EraseCheckout(checkoutID string) error
- func (s *Server) FileStore(ctx context.Context, file io.ReadCloser, checksum string, filesize int64, ...) error
- func (s *Server) FileStoreCheck(ctx context.Context, checksum string, filesize int64) api.ShamanFileStatus
- func (s *Server) GCStorage(doDryRun bool) (stats GCStats)
- func (s *Server) Go()
- func (s *Server) IsEnabled() bool
- func (s *Server) Requirements(ctx context.Context, requirements api.ShamanRequirementsRequest) (api.ShamanRequirementsResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ErrDoesNotExist = checkout.ErrDoesNotExist
Functions ¶
This section is empty.
Types ¶
type GCStats ¶
type GCStats struct {
// contains filtered or unexported fields
}
GCStats contains statistics of a garbage collection run.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a Shaman Server.
func NewServer ¶
func NewServer(conf config.Config, auther jwtauth.Authenticator) *Server
NewServer creates a new Shaman server.
func (*Server) Checkout ¶
Checkout creates a directory, and symlinks the required files into it. The files must all have been uploaded to Shaman before calling this.
func (*Server) EraseCheckout ¶
EraseCheckout deletes the symlinks and the directory structure that makes up the checkout.
func (*Server) FileStore ¶
func (s *Server) FileStore(ctx context.Context, file io.ReadCloser, checksum string, filesize int64, canDefer bool, originalFilename string) error
Store a new file on the Shaman server. Note that the Shaman server can return early when another client finishes uploading the exact same file, to prevent double uploads.
func (*Server) FileStoreCheck ¶
func (s *Server) FileStoreCheck(ctx context.Context, checksum string, filesize int64) api.ShamanFileStatus
Check the status of a file on the Shaman server. status (stored, currently being uploaded, unknown).
func (*Server) GCStorage ¶
GCStorage performs garbage collection by deleting files from storage that are not symlinked in a checkout and haven't been touched since a threshold date.
func (*Server) Go ¶
func (s *Server) Go()
Go starts goroutines for background operations. After Go() has been called, use Close() to stop those goroutines.
func (*Server) Requirements ¶
func (s *Server) Requirements(ctx context.Context, requirements api.ShamanRequirementsRequest) (api.ShamanRequirementsResponse, error)
Requirements checks a Shaman Requirements file, and returns the subset containing the unknown files.