client

package
v1.18.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 14 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 MakeClient

func MakeClient(url string) *Client

Client creates a storage service client.

func (*Client) Delete

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

func (*Client) Download

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

Download fetches the file identified by ID to the local file path. filePath must not exist.

func (*Client) GetFile added in v1.18.0

func (c *Client) GetFile(ctx context.Context, id string) (resp *http.Response, err error)

Download fetches the file identified by ID to the local file path. filePath must not exist.

func (*Client) GetUrl

func (c *Client) GetUrl(id string) string

GetUrl returns an HTTP URL that can be used to download the file pointed to by ID

func (*Client) List added in v1.17.0

func (c *Client) List(ctx context.Context) ([]string, error)

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, filePath string, metadata *map[string]string) (string, error)

Upload sends the local file pointed to by filePath to the storage service, along with the metadata. It returns a file ID that can be used to retrieve the file.

Jump to

Keyboard shortcuts

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