Versions in this module Expand all Collapse all v0 v0.1.0 Jan 14, 2024 Changes in this version + const DefaultMaxRetries + const DefaultTimeout + const ErrApplicationKeyRequired + const ErrConfigRequired + const ErrEndpointRequired + const ErrInvalidApplication + const ErrInvalidConfig + const ErrInvalidEndpoint + const ErrStorageZoneKeyRequired + const ErrStorageZoneNameRequired + const ErrStorageZoneRequired + const ErrUserAgentRequired + func ComputeSHA256(r io.Reader) (string, error) + type Client struct + func NewClient(cfg *Config) (*Client, error) + func (c *Client) Delete(ctx context.Context, path, filename string) (*resty.Response, error) + func (c *Client) Download(ctx context.Context, path, filename string) ([]byte, *resty.Response, error) + func (c *Client) List(ctx context.Context, path string) ([]*Object, *resty.Response, error) + func (c *Client) Upload(ctx context.Context, path, filename, checksum string, body io.Reader) (*resty.Response, error) + type Config struct + Debug bool + Endpoint Endpoint + Key string + Logger Logger + MaxRetries int + ReadOnlyKey string + StorageZone string + Timeout time.Duration + UserAgent string + func (c *Config) AccessKey(op Operation) string + type Endpoint int + const EndpointFalkenstein + const EndpointJohannesburg + const EndpointLocalhost + const EndpointLondon + const EndpointLosAngeles + const EndpointNewYork + const EndpointSaoPaulo + const EndpointSingapore + const EndpointStockholm + const EndpointSydney + func Parse(s string) Endpoint + func (e Endpoint) IsValid() bool + func (e Endpoint) String() string + type Logger interface + Printf func(format string, v ...any) + type Object struct + ArrayNumber int + Checksum string + ContentType string + DateCreated string + GUID string + IsDirectory bool + LastChanged string + Length int + ObjectName string + Path string + ReplicatedZones string + ServerID int + StorageZoneID int + StorageZoneName string + UserID string + type Operation int + const OperationRead + const OperationWrite + type Response struct + Body []byte + Header http.Header + Status int