bunny

package
v0.0.0-...-51ba4d7 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ClientUserAgent = "go-bunnyapi-client 1.0"

Variables

This section is empty.

Functions

func RegionsDistanceKm

func RegionsDistanceKm(a, b *Region) float64

func ServerRegionCode

func ServerRegionCode(h *http.Header) (string, error)

func StorageServerRegionCode

func StorageServerRegionCode(h *http.Header) (string, error)

Types

type Client

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

func NewClient

func NewClient(accessKey string) *Client

func (*Client) EdgeServersIP

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

func (*Client) NewStorageZoneClient

func (c *Client) NewStorageZoneClient(ctx context.Context, zoneName string) (*StorageZoneClient, error)

func (*Client) Regions

func (c *Client) Regions(ctx context.Context) ([]Region, error)

func (*Client) StorageZoneByName

func (c *Client) StorageZoneByName(ctx context.Context, name string) (*StorageZone, error)

func (*Client) StorageZones

func (c *Client) StorageZones(ctx context.Context) ([]StorageZone, error)

type Region

type Region struct {
	Id               int
	Name             string
	PricePerGigabyte float64
	RegionCode       string
	ContinentCode    string
	CountryCode      string
	Latitude         float64
	Longitude        float64
}

type StorageZone

type StorageZone struct {
	Id                          int
	UserId                      string
	Name                        string
	Password                    string
	DateModified                string
	Deleted                     bool
	StorageUsed                 int64
	FilesStored                 int64
	Region                      string
	ReplicationRegions          []string
	ReadOnlyPassword            string
	Rewrite404To200             bool
	Custom404FilePath           string
	StorageHostname             string
	ZoneTier                    int
	ReplicationChangeInProgress bool
	PriceOverride               float64
	Discount                    int
}

type StorageZoneClient

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

func NewStorageZoneClient

func NewStorageZoneClient(zoneName, storageEndpoint, accessKey string) *StorageZoneClient

func (*StorageZoneClient) Delete

func (sz *StorageZoneClient) Delete(ctx context.Context, filePath string) error

func (*StorageZoneClient) Download

func (sz *StorageZoneClient) Download(ctx context.Context, filePath string) (io.ReadCloser, int, error)

func (*StorageZoneClient) List

func (sz *StorageZoneClient) List(ctx context.Context, dirPath string) ([]string, error)

func (*StorageZoneClient) Upload

func (sz *StorageZoneClient) Upload(ctx context.Context, filePath string, contents io.Reader) error

Jump to

Keyboard shortcuts

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