appstore

package
v0.120.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppStore

type AppStore struct {
	HTTPClient *http.Client
	URL        string
	Username   string
	AccessKey  string
}

AppStore implements a remote file storage for storage.AppService. See https://wiki.saucelabs.com/display/DOCS/Application+Storage for more details.

func New

func New(url, username, accessKey string, timeout time.Duration) *AppStore

New returns an implementation for AppStore

func (*AppStore) Download added in v0.107.0

func (s *AppStore) Download(id string) (io.ReadCloser, int64, error)

Download downloads a file with the given id. It's the caller's responsibility to close the reader.

func (*AppStore) Find deprecated added in v0.46.0

func (s *AppStore) Find(filename string) (storage.Item, error)

Find looks for a file having the same signature.

Deprecated: Use List instead.

func (*AppStore) List added in v0.107.0

func (s *AppStore) List(opts storage.ListOptions) (storage.List, error)

List returns a list of items stored in the Sauce app storage that match the search criteria specified by opts.

func (*AppStore) Upload deprecated

func (s *AppStore) Upload(filename string, description string) (storage.Item, error)

Upload uploads file to remote storage

Deprecated: Use UploadStream.

func (*AppStore) UploadStream added in v0.107.0

func (s *AppStore) UploadStream(filename, description string, reader io.Reader) (storage.Item, error)

UploadStream uploads the contents of reader and stores them under the given filename.

type Item added in v0.21.0

type Item struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Size            int    `json:"size"`
	UploadTimestamp int64  `json:"upload_timestamp"`
}

Item represents the metadata about the uploaded file.

type Links struct {
	Self string `json:"self"`
	Prev string `json:"prev"`
	Next string `json:"next"`
}

Links represents the pagination information returned by the app store.

type ListResponse added in v0.46.0

type ListResponse struct {
	Items      []Item `json:"items"`
	Links      Links  `json:"links"`
	Page       int    `json:"page"`
	PerPage    int    `json:"per_page"`
	TotalItems int    `json:"total_items"`
}

ListResponse represents the response as is returned by the app store.

type UploadResponse added in v0.21.0

type UploadResponse struct {
	Item Item `json:"item"`
}

UploadResponse represents the response as is returned by the app store.

Jump to

Keyboard shortcuts

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