client

package
v0.0.0-...-73591c8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 24 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) DeleteRevision

func (c *Client) DeleteRevision(ctx context.Context, id, fileName, revision string) error

func (*Client) GetRevision

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

func (*Client) ListRevisions

func (c *Client) ListRevisions(ctx context.Context, id, fileName string) ([]RevisionInfo, 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, opts ...WriteOptions) error

type ConflictError

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

func (*ConflictError) Error

func (e *ConflictError) Error() string

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
}

type RevisionInfo

type RevisionInfo struct {
	FileInfo
	RevisionID string `json:"revisionID"`
}

type WriteOptions

type WriteOptions struct {
	CreateRevision *bool
	// If LatestRevision is set, then a conflict error will be returned if that revision is not the latest.
	LatestRevision string
}

Jump to

Keyboard shortcuts

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