Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(readDir string) proto.FileHandler
NewHandler is a handler that can be registered with a micro Server
func RegisterHandler ¶
RegisterHandler is a convenience method for registering a handler
Types ¶
type Client ¶
type Client interface { Open(ctx context.Context, filename string, new bool) (int64, error) Stat(ctx context.Context, filename string) (*proto.StatResponse, error) GetBlock(ctx context.Context, sessionId, blockId int64) ([]byte, error) Read(ctx context.Context, sessionId int64, buf []byte) (int, error) ReadAt(ctx context.Context, sessionId, offset, size int64) ([]byte, error) Close(ctx context.Context, sessionId int64) error Download(filename, saveFile string) error DownloadAt(ctx context.Context, filename, saveFile string, blockId int) error Upload(localfile, filename string) error UploadAt(ctx context.Context, localfile, filename string, blockId int) error UploadStream(ctx context.Context, b []byte, filename string, blockId int) error Remove(ctx context.Context, filename string) error }
Client is the client interface to access files
Click to show internal directories.
Click to hide internal directories.