Documentation ¶
Index ¶
- Constants
- func WithArchives() nodes.Option
- type Handler
- func (a *Handler) Adapt(h nodes.Handler, options nodes.RouterOptions) nodes.Handler
- func (a *Handler) GetObject(ctx context.Context, node *tree.Node, requestData *models.GetRequestData) (io.ReadCloser, error)
- func (a *Handler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...grpc.CallOption) (tree.NodeProvider_ListNodesClient, error)
- func (a *Handler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...grpc.CallOption) (*tree.ReadNodeResponse, error)
- type Reader
- func (a *Reader) ExtractAllTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, ...) error
- func (a *Reader) ExtractAllZip(ctx context.Context, archiveNode *tree.Node, targetNode *tree.Node, ...) error
- func (a *Reader) ListChildrenTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, ...) ([]*tree.Node, error)
- func (a *Reader) ListChildrenZip(ctx context.Context, archiveNode *tree.Node, parentPath string, stat ...bool) ([]*tree.Node, error)
- func (a *Reader) ReadChildTar(ctx context.Context, gzipFormat bool, writer io.WriteCloser, ...) (int64, error)
- func (a *Reader) ReadChildZip(ctx context.Context, archiveNode *tree.Node, innerPath string) (io.ReadCloser, error)
- func (a *Reader) StatChildTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, innerPath string) (*tree.Node, error)
- func (a *Reader) StatChildZip(ctx context.Context, archiveNode *tree.Node, innerPath string) (*tree.Node, error)
- type Writer
Constants ¶
const UnCompressThreshold = int64(100)
Variables ¶
This section is empty.
Functions ¶
func WithArchives ¶
Types ¶
type Handler ¶
Handler dynamically create archives when downloading folders and supports archive contents listing.
func (*Handler) GetObject ¶
func (a *Handler) GetObject(ctx context.Context, node *tree.Node, requestData *models.GetRequestData) (io.ReadCloser, error)
GetObject overrides the response of GetObject if it is sent on a folder key : create an archive on-the-fly.
func (*Handler) ListNodes ¶
func (a *Handler) ListNodes(ctx context.Context, in *tree.ListNodesRequest, opts ...grpc.CallOption) (tree.NodeProvider_ListNodesClient, error)
func (*Handler) ReadNode ¶
func (a *Handler) ReadNode(ctx context.Context, in *tree.ReadNodeRequest, opts ...grpc.CallOption) (*tree.ReadNodeResponse, error)
ReadNode overrides the response of ReadNode to create a fake stat for archive file
type Reader ¶
func (*Reader) ExtractAllTar ¶
func (a *Reader) ExtractAllTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, targetNode *tree.Node, logChannels ...chan string) error
ExtractAllTar extracts all files contained in a tar/tar.gz archive to a given location
func (*Reader) ExtractAllZip ¶
func (a *Reader) ExtractAllZip(ctx context.Context, archiveNode *tree.Node, targetNode *tree.Node, logChannels ...chan string) error
ExtractAllZip extracts all files contained in a zip archive to a given location
func (*Reader) ListChildrenTar ¶
func (a *Reader) ListChildrenTar(ctx context.Context, gzipFormat bool, archiveNode *tree.Node, parentPath string, stat ...bool) ([]*tree.Node, error)
ListChildrenTar extracts all children from a tar/tar.gz archive
func (*Reader) ListChildrenZip ¶
func (a *Reader) ListChildrenZip(ctx context.Context, archiveNode *tree.Node, parentPath string, stat ...bool) ([]*tree.Node, error)
ListChildrenZip extracts all children from a zip archive
func (*Reader) ReadChildTar ¶
func (a *Reader) ReadChildTar(ctx context.Context, gzipFormat bool, writer io.WriteCloser, archiveNode *tree.Node, innerPath string) (int64, error)
ReadChildTar reads content of a file contained in a tar/tar.gz archive
func (*Reader) ReadChildZip ¶
func (a *Reader) ReadChildZip(ctx context.Context, archiveNode *tree.Node, innerPath string) (io.ReadCloser, error)
ReadChildZip reads content of a file contained in a zip archive
type Writer ¶
type Writer struct { Router nodes.Handler // Optional filter when listing nodes to build the archive WalkFilter nodes.WalkFilterFunc }