storage

package
v0.135.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccessDenied = errors.New("access denied")

ErrAccessDenied is returned when the service denies access. Either due to insufficient rights or wrong credentials.

View Source
var ErrFileNotFound = errors.New("file not found")

ErrFileNotFound is returned when the requested file does not exist.

View Source
var ErrTooManyRequest = errors.New("too many requests, please try again later")

ErrTooManyRequest is returned when the request number is exceeding rate limit.

Functions

This section is empty.

Types

type AppService added in v0.107.0

type AppService interface {
	// UploadStream uploads the contents of reader and stores them under the given filename.
	UploadStream(filename, description string, reader io.Reader) (Item, error)
	Download(id string) (io.ReadCloser, int64, error)
	DownloadURL(url string) (io.ReadCloser, int64, error)
	List(opts ListOptions) (List, error)
}

AppService is the interface for interacting with the Sauce application storage.

type Item added in v0.107.0

type Item struct {
	ID       string    `json:"id"`
	Name     string    `json:"name"`
	Size     int       `json:"size"`
	Uploaded time.Time `json:"uploaded"`
}

Item represents the file in storage.

type List added in v0.107.0

type List struct {
	Items     []Item `json:"items"`
	Truncated bool   `json:"truncated"`
}

type ListOptions added in v0.107.0

type ListOptions struct {
	// Q is any search term (such as app name, file name, description, build number or version) by which you want to filter.
	Q string

	// Name is the filename (case-insensitive) by which you want to filter.
	Name string

	// SHA256 is the checksum of the file by which you want to filter.
	SHA256 string

	// Limits the number of results returned.
	MaxResults int
}

ListOptions represents parameters that modify the file list behavior.

type ServerError added in v0.107.0

type ServerError struct {
	Code  int
	Title string
	Msg   string
}

ServerError represents any server side error that isn't already covered by other types of errors in this package.

func (*ServerError) Error added in v0.107.0

func (s *ServerError) Error() string

Jump to

Keyboard shortcuts

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