Documentation ¶
Overview ¶
Package pyre provides a gRPC-based implementation of B2, as well as a RESTful gateway on top of it.
Index ¶
- func RegisterDownloadManagerOnMux(d DownloadManager, mux *http.ServeMux)
- func RegisterLargeFileManagerOnMux(f LargeFileManager, mux *http.ServeMux)
- func RegisterServerOnMux(ctx context.Context, srv *Server, mux *http.ServeMux) error
- func RegisterSimpleFileManagerOnMux(f SimpleFileManager, mux *http.ServeMux)
- type AccountManager
- type BucketManager
- type DownloadManager
- type DownloadableObject
- type LargeFileManager
- type LargeFileOrganizer
- type ListManager
- type Server
- func (s *Server) AuthorizeAccount(ctx context.Context, req *pb.AuthorizeAccountRequest) (*pb.AuthorizeAccountResponse, error)
- func (s *Server) CreateBucket(ctx context.Context, req *pb.Bucket) (*pb.Bucket, error)
- func (s *Server) DeleteBucket(ctx context.Context, req *pb.Bucket) (*pb.Bucket, error)
- func (s *Server) FinishLargeFile(ctx context.Context, req *pb.FinishLargeFileRequest) (*pb.FinishLargeFileResponse, error)
- func (s *Server) GetUploadPartUrl(ctx context.Context, req *pb.GetUploadPartUrlRequest) (*pb.GetUploadPartUrlResponse, error)
- func (s *Server) GetUploadUrl(ctx context.Context, req *pb.GetUploadUrlRequest) (*pb.GetUploadUrlResponse, error)
- func (s *Server) ListBuckets(ctx context.Context, req *pb.ListBucketsRequest) (*pb.ListBucketsResponse, error)
- func (s *Server) ListFileVersions(ctx context.Context, req *pb.ListFileVersionsRequest) (*pb.ListFileVersionsResponse, error)
- func (s *Server) StartLargeFile(ctx context.Context, req *pb.StartLargeFileRequest) (*pb.StartLargeFileResponse, error)
- type SimpleFileManager
- type VersionedObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDownloadManagerOnMux ¶
func RegisterDownloadManagerOnMux(d DownloadManager, mux *http.ServeMux)
func RegisterLargeFileManagerOnMux ¶
func RegisterLargeFileManagerOnMux(f LargeFileManager, mux *http.ServeMux)
func RegisterServerOnMux ¶
func RegisterSimpleFileManagerOnMux ¶
func RegisterSimpleFileManagerOnMux(f SimpleFileManager, mux *http.ServeMux)
Types ¶
type AccountManager ¶
type AccountManager interface { Authorize(acct, key string) (string, error) CheckCreds(token, api string) error APIRoot(acct string) string DownloadRoot(acct string) string UploadPartHost(fileID string) (string, error) UploadHost(id string) (string, error) Sizes(acct string) (recommended, minimum int32) }
type BucketManager ¶
type DownloadManager ¶
type DownloadableObject ¶
type LargeFileManager ¶
type LargeFileManager interface {
PartWriter(id string, part int) (io.WriteCloser, error)
}
type LargeFileOrganizer ¶
type ListManager ¶
type ListManager interface { // NextN returns the next n objects, sorted by lexicographical order by name, // beginning at and including, if it exists, fileName. If withPrefix is not // empty, it only returns names that begin with that prefix. If skipPrefix // is not empty, then the no files with that prefix are returned. If the two // conflict, skipPrefix wins (i.e., do not return the entry). // // If fewer than n entries are returned, this signifies that no more names // exist that meet these criteria. NextN(bucketID, fileName, withPrefix, skipPrefix string, n int) ([]VersionedObject, error) }
type Server ¶
type Server struct { Account AccountManager Bucket BucketManager LargeFile LargeFileOrganizer List ListManager }
func (*Server) AuthorizeAccount ¶
func (s *Server) AuthorizeAccount(ctx context.Context, req *pb.AuthorizeAccountRequest) (*pb.AuthorizeAccountResponse, error)
func (*Server) CreateBucket ¶
func (*Server) DeleteBucket ¶
func (*Server) FinishLargeFile ¶
func (s *Server) FinishLargeFile(ctx context.Context, req *pb.FinishLargeFileRequest) (*pb.FinishLargeFileResponse, error)
func (*Server) GetUploadPartUrl ¶
func (s *Server) GetUploadPartUrl(ctx context.Context, req *pb.GetUploadPartUrlRequest) (*pb.GetUploadPartUrlResponse, error)
func (*Server) GetUploadUrl ¶
func (s *Server) GetUploadUrl(ctx context.Context, req *pb.GetUploadUrlRequest) (*pb.GetUploadUrlResponse, error)
func (*Server) ListBuckets ¶
func (s *Server) ListBuckets(ctx context.Context, req *pb.ListBucketsRequest) (*pb.ListBucketsResponse, error)
func (*Server) ListFileVersions ¶
func (s *Server) ListFileVersions(ctx context.Context, req *pb.ListFileVersionsRequest) (*pb.ListFileVersionsResponse, error)
func (*Server) StartLargeFile ¶
func (s *Server) StartLargeFile(ctx context.Context, req *pb.StartLargeFileRequest) (*pb.StartLargeFileResponse, error)
type SimpleFileManager ¶
type SimpleFileManager interface {
Writer(bucket, name, id string) (io.WriteCloser, error)
}
Click to show internal directories.
Click to hide internal directories.