Documentation ¶
Index ¶
- type ChunkerParams
- type Config
- type Server
- func (srv *Server) ChunksExist(ctx context.Context, req *pb.ChunksExistRequest) (*pb.ChunksExistResponse, error)
- func (srv *Server) Copy(ctx context.Context, req *pb.CopyRequest) (*pb.FileID, error)
- func (srv *Server) CreateFile(ctx context.Context, file *pb.File) (*pb.FileID, error)
- func (srv *Server) Delete(ctx context.Context, fileID *pb.FileID) (*pb.Empty, error)
- func (srv *Server) Download(ctx context.Context, id *pb.FileID) (*pb.DownloadResponse, error)
- func (srv *Server) GetChunkerParams(ctx context.Context, _ *pb.Empty) (*pb.ChunkerParams, error)
- func (srv *Server) Head(ctx context.Context, req *pb.HeadRequest) (*pb.HeadResponse, error)
- func (srv *Server) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)
- func (srv *Server) PackfileUploadHandler(w http.ResponseWriter, req *http.Request)
- func (srv *Server) ServerStats(ctx context.Context, _ *pb.Empty) (*pb.Stats, error)
- func (srv *Server) SetLogger(logger zerolog.Logger)
- func (srv *Server) StartVacuum(ctx context.Context, _ *pb.Empty) (*pb.VacuumID, error)
- func (srv *Server) VacuumStatus(ctx context.Context, id *pb.VacuumID) (*pb.Vacuum, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkerParams ¶
type ChunkerParams struct { MinChunkSize uint `json:"min_chunk_size"` AvgChunkSize uint `json:"avg_chunk_size"` MaxChunkSize uint `json:"max_chunk_size"` Normalization uint `json:"normalization"` }
ChunkerParams store the parameters that should be used to chunk files for a server.
type Config ¶
type Config struct { // Bucket is the bucket the server saves files to. Bucket string // VersioningEnabled, if set to true, turns on file versioning. VersioningEnabled bool // MaxChunkSize is the maximum permitted size of a chunk in bytes. MaxChunkSize uint64 // MaxPackfileSize is the maximum permitted size of a packfile in bytes. MaxPackfileSize uint64 DownloadTimeout time.Duration Params ChunkerParams }
Config stores the configuration for the Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements the Api interface specified in upload.proto.
func (*Server) ChunksExist ¶
func (srv *Server) ChunksExist(ctx context.Context, req *pb.ChunksExistRequest) (*pb.ChunksExistResponse, error)
ChunksExist checks if a list of chunks already exist in the store. The response contains a boolean for each chunk in the request.
func (*Server) Copy ¶
Copy makes a copy of a file and returns its ID. Returns a NotFound error if the file does not exist.
func (*Server) CreateFile ¶
CreateFile creates a new file. Returns an error if any chunk referenced by the file does not exist.
func (*Server) Delete ¶
Delete removes a file. Returns a NotFound error if the files does not exist.
func (*Server) Download ¶
Download returns a collection of URLs to download the data for a file. Each URL contains data for a contiguous section of the file.
func (*Server) GetChunkerParams ¶
GetChunkerParams returns the chunking parameters that clients should use to chunk files for this server.
func (*Server) Head ¶
func (srv *Server) Head(ctx context.Context, req *pb.HeadRequest) (*pb.HeadResponse, error)
Head returns all versions of a file with a given name. The parameters Limit, NextPageToken and Ascending have the same meaning as in the List method.
func (*Server) List ¶
func (srv *Server) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)
List returns all versions of files with a given prefix. The response NextPageToken can be used to retrieve the next page of results, unless it has the value -1, in which case no further pages exist. The parameter Limit sets the maximum number of results per page and must be provided. The parameter Exclude may be provided as a glob pattern to exclude files from the response. If Exclude is set, the Include parameter may also be provided to force inclusion of any files excluded by the Exclude pattern. Results are returned in reverse-chronological order of file created date by default. Ascending may be set to true to reverse the order.
func (*Server) PackfileUploadHandler ¶
func (srv *Server) PackfileUploadHandler(w http.ResponseWriter, req *http.Request)
PackfileUploadHandler accepts a Packfile from a client and saves it to the store.
func (*Server) ServerStats ¶
ServerStats returns summary statistics for the server.
func (*Server) StartVacuum ¶
StartVacuum starts a new vacuum process. Returns a twirp.Unavailable error if a vacuum process is already running. Returns an ID for the vacuum which can be used to check the status of the vacuum.