api

package
v0.0.0-...-b10b9e3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RETENTION_BY_DAYS  retentionType = 1
	RETENTION_BY_COUNT retentionType = 2
)
View Source
const (
	SCHEDULE_ON_DEMAND scheduleType = 1
	SCHEDULE_HOURLY    scheduleType = 2
	SCHEDULE_DAILY     scheduleType = 3
	SCHEDULE_WEEKLY    scheduleType = 4
	SCHEDULE_MONTHLY   scheduleType = 5
)
View Source
const (
	DB_MYSQL    databaseType = 1
	DB_MONGO    databaseType = 2
	DB_POSTGRES databaseType = 3
)
View Source
const ISO_8601_FORMAT = "2006-01-02T15:04:05-0700"

Variables

This section is empty.

Functions

func NewSignedHTTPClient

func NewSignedHTTPClient(accessKey, secretKey string, timeoutSecs int) *signedHTTPClient

func ParseDatabaseType

func ParseDatabaseType(s string) (databaseType, error)

func ParseRetentionType

func ParseRetentionType(s string) (retentionType, error)

func ParseScheduleType

func ParseScheduleType(s string) (scheduleType, error)

Types

type Client

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

func NewAPIClient

func NewAPIClient(host, accessKey, accessSecret string) (*Client, error)

func (*Client) CreateRetention

func (c *Client) CreateRetention(name string, retentionType retentionType,
	count int) (retention Retention, err error)

func (*Client) CreateSchedule

func (c *Client) CreateSchedule(name string, scheduleType scheduleType, hours string,
	days string) (schedule Schedule, err error)

func (*Client) CreateServer

func (c *Client) CreateServer(name string, dbType databaseType, readonly bool,
	dbHost, dbPort, dbUser, dbPass string) (server Server, err error)

func (*Client) CreateStorage

func (c *Client) CreateStorage(name string, storageType StorageType,
	localPath, bucket, region, accessKey, secretKey string) (storage Storage, err error)

func (*Client) DeleteRetention

func (c *Client) DeleteRetention(id int) error

func (*Client) DeleteSchedule

func (c *Client) DeleteSchedule(id int) error

func (*Client) DeleteServer

func (c *Client) DeleteServer(id int) error

func (*Client) DeleteStorage

func (c *Client) DeleteStorage(id int) error

func (*Client) GetBackupKeys

func (c *Client) GetBackupKeys() (body []byte, err error)

func (*Client) GetRetention

func (c *Client) GetRetention(id int) (retention Retention, err error)

func (*Client) GetSchedule

func (c *Client) GetSchedule(id int) (schedule Schedule, err error)

func (*Client) GetServer

func (c *Client) GetServer(id int) (server Server, err error)

func (*Client) GetServerInstall

func (c *Client) GetServerInstall(id int) (body []byte, err error)

func (*Client) GetStorage

func (c *Client) GetStorage(id int) (storage Storage, err error)

func (*Client) String

func (c *Client) String() string

func (*Client) UpdateRetention

func (c *Client) UpdateRetention(r Retention) error

func (*Client) UpdateSchedule

func (c *Client) UpdateSchedule(s Schedule) error

func (*Client) UpdateServer

func (c *Client) UpdateServer(s Server) error

func (*Client) UpdateStorage

func (c *Client) UpdateStorage(s Storage) error

type Retention

type Retention struct {
	ID            int           `json:"id"`
	Name          string        `json:"name"`
	RetentionType retentionType `json:"retentionType"`
	Count         int           `json:"count"`
}

func (Retention) JSONString

func (r Retention) JSONString() string

func (Retention) String

func (r Retention) String() string

type Schedule

type Schedule struct {
	ID            int          `json:"id"`
	Name          string       `json:"name"`
	ScheduleType  scheduleType `json:"scheduleType"`
	ScheduleHours string       `json:"scheduleHours"`
	ScheduleDays  string       `json:"scheduleDays"`
}

func (Schedule) JSONString

func (s Schedule) JSONString() string

func (Schedule) String

func (s Schedule) String() string

type Server

type Server struct {
	ID       int          `json:"id"`
	Name     string       `json:"name"`
	DbType   databaseType `json:"dbTypeId"`
	Readonly bool         `json:"readonly"`
	DbHost   string       `json:"dbHost"`
	DbPort   string       `json:"dbPort"`
	DbUser   string       `json:"dbUser"`
	DbPass   string       `json:"dbPass"`
}

func (Server) JSONString

func (s Server) JSONString() string

func (Server) String

func (s Server) String() string

type Storage

type Storage struct {
	ID             int         `json:"id"`
	Name           string      `json:"name"`
	StorageType    StorageType `json:"storageType"`
	LocalPath      string      `json:"localPath"`
	Bucket         string      `json:"bucket"`
	AccessKey      string      `json:"storage-access-key"`
	SecretKey      string      `json:"storage-secret-key"`
	RegionEndpoint string      `json:"region-endpoint"`
}

func (Storage) JSONString

func (s Storage) JSONString() string

func (Storage) String

func (s Storage) String() string

type StorageType

type StorageType int
const (
	STORAGE_LOCAL        StorageType = 1
	STORAGE_S3           StorageType = 2
	STORAGE_GOOGLE       StorageType = 5
	STORAGE_DIGITALOCEAN StorageType = 6
	STORAGE_ALIBABA      StorageType = 7
)

func ParseStorageType

func ParseStorageType(s string) (StorageType, error)

func (StorageType) String

func (s StorageType) String() string

Jump to

Keyboard shortcuts

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