space

package
v0.0.0-...-09d31aa Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Connect

func Connect(cfg config.Space) (*Client, error)

Connect connects to a S3 space.

func (*Client) DownloadFile

func (client *Client) DownloadFile(ctx context.Context, path string) (io.ReadCloser, error)

DownloadFile opens a file for download, using the same path format as the UploadFile function. Remember to Close it! The returned stream also has `ReaderAt` and `Seeker`, but those are impl. details.

func (*Client) MaxSize

func (client *Client) MaxSize() int64

func (*Client) RemoveFile

func (client *Client) RemoveFile(name string) error

RemoveFile removes a file from the space

func (*Client) URLFromPath

func (client *Client) URLFromPath(path string) string

URLFromPath gets the URL from the path returned by UploadFile

func (*Client) UploadFile

func (client *Client) UploadFile(ctx context.Context, name string, mimeType string, reader io.Reader, size int64) error

UploadFile uploads the file to the space. This does not do any checks on it, so the endpoints should ensure that's all okay.

Jump to

Keyboard shortcuts

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