regions

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package regions contains the API calls for the Active-Active Subscription regions service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(client HttpClient, task Task, logger Log) *API

func (API) List

func (a API) List(ctx context.Context, subId int) (*Regions, error)

List will list all of a given subscription's active-active regions.

type Database

type Database struct {
	DatabaseId               *int    `json:"databaseId,omitempty"`
	DatabaseName             *string `json:"DatabaseName,omitempty"`
	ReadOperationsPerSecond  *int    `json:"readOperationsPerSecond,omitempty"`
	WriteOperationsPerSecond *int    `json:"writeOperationsPerSecond,omitempty"`
}

type HttpClient

type HttpClient interface {
	Get(ctx context.Context, name, path string, responseBody interface{}) error
	Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Delete(ctx context.Context, name, path string, responseBody interface{}) error
}

type Log

type Log interface {
	Printf(format string, args ...interface{})
}

type Region

type Region struct {
	RegionId       *int        `json:"regionId,omitempty"`
	Region         *string     `json:"region,omitempty"`
	DeploymentCIDR *string     `json:"deploymentCIDR,omitempty"`
	VpcId          *string     `json:"vpcId,omitempty"`
	Databases      []*Database `json:"databases,omitempty"`
}

func (Region) String

func (o Region) String() string

type Regions

type Regions struct {
	SubscriptionId *int      `json:"subscriptionId,omitempty"`
	Regions        []*Region `json:"regions,omitempty"`
}

func (Regions) String

func (o Regions) String() string

type Task

type Task interface {
	WaitForResourceId(ctx context.Context, id string) (int, error)
	WaitForResource(ctx context.Context, id string, resource interface{}) error
	Wait(ctx context.Context, id string) error
}

Jump to

Keyboard shortcuts

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