client

package
v0.0.0-...-b70ef6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectoryProvider = "directory"
	S3Provider        = "s3"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts ...Options) (*Client, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, provider string, fromWorkspaces ...string) (string, error)

func (*Client) DeleteFile

func (c *Client) DeleteFile(ctx context.Context, id, file string) error

func (*Client) Ls

func (c *Client) Ls(ctx context.Context, id, prefix string) ([]string, error)

func (*Client) OpenFile

func (c *Client) OpenFile(ctx context.Context, id, fileName string) (io.ReadCloser, error)

func (*Client) Providers

func (c *Client) Providers() []string

func (*Client) RemoveAllWithPrefix

func (c *Client) RemoveAllWithPrefix(ctx context.Context, id, prefix string) error

func (*Client) Rm

func (c *Client) Rm(ctx context.Context, id string) error

func (*Client) StatFile

func (c *Client) StatFile(ctx context.Context, id, fileName string) (FileInfo, error)

func (*Client) WriteFile

func (c *Client) WriteFile(ctx context.Context, id, fileName string, reader io.Reader) error

type FileInfo

type FileInfo struct {
	WorkspaceID string    `json:"workspaceID"`
	Name        string    `json:"name"`
	Size        int64     `json:"size"`
	ModTime     time.Time `json:"modTime"`
	MimeType    string    `json:"mimeType"`
}

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type Options

type Options struct {
	DirectoryDataHome string
	S3BucketName      string
	S3BaseEndpoint    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL