databases

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtocolValues

func ProtocolValues() []string

Types

type API

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

func NewAPI

func NewAPI(client HttpClient, taskWaiter TaskWaiter, logger Log) *API

func (*API) Backup

func (a *API) Backup(ctx context.Context, subscription int, database int) error

Backup will create a manual backup of the database to the destination the fixed database has been configured to backup to.

func (*API) Create

func (a *API) Create(ctx context.Context, subscription int, db CreateFixedDatabase) (int, error)

Create will create a new fixed database for the subscription and return the identifier of the database.

func (*API) Delete

func (a *API) Delete(ctx context.Context, subscription int, database int) error

Delete will destroy an existing fixed database.

func (*API) Get

func (a *API) Get(ctx context.Context, subscription int, database int) (*FixedDatabase, error)

Get will retrieve an existing fixed database.

func (*API) Import

func (a *API) Import(ctx context.Context, subscription int, database int, request Import) error

Import will import data from an RDB file or another Redis database into an existing fixed database.

func (*API) List

func (a *API) List(ctx context.Context, subscription int) *ListFixedDatabase

List will return a ListDatabase that is capable of paging through all of the databases associated with a subscription.

func (*API) Update

func (a *API) Update(ctx context.Context, subscription int, database int, update UpdateFixedDatabase) error

Update will update certain values of an existing fixed database.

type Backup

type Backup struct {
	Enabled *bool   `json:"remoteBackupEnabled,omitempty"`
	Status  *string `json:"status,omitempty"`
}

func (Backup) String

func (o Backup) String() string

type Clustering

type Clustering struct {
	Enabled       *bool                  `json:"enabled,omitempty"`
	RegexRules    []*databases.RegexRule `json:"regexRules,omitempty"`
	HashingPolicy *string                `json:"hashingPolicy,omitempty"`
}

func (Clustering) String

func (o Clustering) String() string

type CreateFixedDatabase

type CreateFixedDatabase struct {
	Name                                *string                `json:"name,omitempty"`
	Protocol                            *string                `json:"protocol,omitempty"`
	MemoryLimitInGB                     *float64               `json:"memoryLimitInGb,omitempty"`
	SupportOSSClusterAPI                *bool                  `json:"supportOSSClusterApi,omitempty"`
	RespVersion                         *string                `json:"respVersion,omitempty"`
	UseExternalEndpointForOSSClusterAPI *bool                  `json:"useExternalEndpointForOSSClusterApi,omitempty"`
	EnableDatabaseClustering            *bool                  `json:"enableDatabaseClustering,omitempty"`
	DataPersistence                     *string                `json:"dataPersistence,omitempty"`
	DataEvictionPolicy                  *string                `json:"dataEvictionPolicy,omitempty"`
	Replication                         *bool                  `json:"replication,omitempty"`
	PeriodicBackupPath                  *string                `json:"periodicBackupPath,omitempty"`
	SourceIPs                           []*string              `json:"sourceIps,omitempty"`
	RegexRules                          []*string              `json:"regexRules,omitempty"`
	Replica                             *ReplicaOf             `json:"replica,omitempty"`
	ClientTlsCertificates               []*DatabaseCertificate `json:"clientTlsCertificates,omitempty"`
	EnableTls                           *bool                  `json:"enableTls,omitempty"`
	Password                            *string                `json:"password,omitempty"`
	Alerts                              *[]*databases.Alert    `json:"alerts,omitempty"`
	Modules                             *[]*databases.Module   `json:"modules,omitempty"`
}

type DatabaseCertificate

type DatabaseCertificate struct {
	Description                *string `json:"description,omitempty"`
	PublicCertificatePEMString *string `json:"publicCertificatePEMString,omitempty"`
}

func (DatabaseCertificate) String

func (o DatabaseCertificate) String() string

type FixedDatabase

type FixedDatabase struct {
	DatabaseId                          *int       `json:"databaseId,omitempty"`
	Name                                *string    `json:"name,omitempty"`
	Protocol                            *string    `json:"protocol,omitempty"`
	Provider                            *string    `json:"provider,omitempty"`
	Region                              *string    `json:"region,omitempty"`
	RedisVersionCompliance              *string    `json:"redisVersionCompliance,omitempty"`
	RespVersion                         *string    `json:"respVersion,omitempty"`
	Status                              *string    `json:"status,omitempty"`
	PlanMemoryLimit                     *float64   `json:"planMemoryLimit,omitempty"`
	MemoryLimitMeasurementUnit          *string    `json:"memoryLimitMeasurementUnit,omitempty"`
	MemoryLimitInGb                     *float64   `json:"memoryLimitInGb,omitempty"`
	MemoryUsedInMb                      *float64   `json:"memoryUsedInMb,omitempty"`
	NetworkMonthlyUsageInByte           *float64   `json:"networkMonthlyUsageInByte,omitempty"`
	MemoryStorage                       *string    `json:"memoryStorage,omitempty"`
	SupportOSSClusterAPI                *bool      `json:"supportOSSClusterApi,omitempty"`
	UseExternalEndpointForOSSClusterAPI *bool      `json:"useExternalEndpointForOSSClusterApi,omitempty"`
	DataPersistence                     *string    `json:"dataPersistence,omitempty"`
	Replication                         *bool      `json:"replication,omitempty"`
	DataEvictionPolicy                  *string    `json:"dataEvictionPolicy,omitempty"`
	ActivatedOn                         *time.Time `json:"activatedOn,omitempty"`
	LastModified                        *time.Time `json:"lastModified,omitempty"`
	PublicEndpoint                      *string    `json:"publicEndpoint,omitempty"`
	PrivateEndpoint                     *string    `json:"privateEndpoint,omitempty"`
	// The following are undocumented but are returned
	Replica    *ReplicaOf           `json:"replica,omitempty"`
	Clustering *Clustering          `json:"clustering,omitempty"`
	Security   *Security            `json:"security,omitempty"`
	Modules    *[]*databases.Module `json:"modules,omitempty"`
	Alerts     *[]*databases.Alert  `json:"alerts,omitempty"`
	Backup     *Backup              `json:"backup,omitempty"`
}

type HttpClient

type HttpClient interface {
	Get(ctx context.Context, name, path string, responseBody interface{}) error
	GetWithQuery(ctx context.Context, name, path string, query url.Values, 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 Import

type Import struct {
	SourceType    *string   `json:"sourceType,omitempty"`
	ImportFromURI []*string `json:"importFromUri,omitempty"`
}

func (Import) String

func (o Import) String() string

type ListFixedDatabase

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

func (*ListFixedDatabase) Err

func (d *ListFixedDatabase) Err() error

Err returns any error that occurred while trying to retrieve the next page of databases.

func (*ListFixedDatabase) Next

func (d *ListFixedDatabase) Next() bool

Next attempts to retrieve the next page of fixed databases and will return false if no more databases were found. Any error that occurs within this function can be retrieved from the `Err()` function.

func (*ListFixedDatabase) Value

func (d *ListFixedDatabase) Value() *FixedDatabase

Value returns the current page of databases.

type Log

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

type NotFound

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

func (*NotFound) Error

func (f *NotFound) Error() string

type ReplicaOf

type ReplicaOf struct {
	Description *string       `json:"description,omitempty"`
	SyncSources []*SyncSource `json:"syncSources,omitempty"`
}

func (ReplicaOf) String

func (o ReplicaOf) String() string

type Security

type Security struct {
	EnableDefaultUser       *bool     `json:"defaultUserEnabled,omitempty"`
	Password                *string   `json:"password,omitempty"`
	SSLClientAuthentication *bool     `json:"sslClientAuthentication,omitempty"`
	TLSClientAuthentication *bool     `json:"tlsClientAuthentication,omitempty"`
	EnableTls               *bool     `json:"enableTls,omitempty"`
	SourceIPs               []*string `json:"sourceIps,omitempty"`
}

func (Security) String

func (o Security) String() string

type SyncSource

type SyncSource struct {
	Description *string `json:"description,omitempty"`
	Endpoint    *string `json:"endpoint,omitempty"`
	Encryption  *bool   `json:"encryption,omitempty"`
	ServerCert  *string `json:"serverCert,omitempty"`
}

func (SyncSource) String

func (o SyncSource) String() string

type TaskWaiter

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

type UpdateFixedDatabase

type UpdateFixedDatabase struct {
	Name                                *string                `json:"name,omitempty"`
	MemoryLimitInGB                     *float64               `json:"memoryLimitInGb,omitempty"`
	SupportOSSClusterAPI                *bool                  `json:"supportOSSClusterApi,omitempty"`
	RespVersion                         *string                `json:"respVersion,omitempty"`
	UseExternalEndpointForOSSClusterAPI *bool                  `json:"useExternalEndpointForOSSClusterApi,omitempty"`
	EnableDatabaseClustering            *bool                  `json:"enableDatabaseClustering,omitempty"`
	DataPersistence                     *string                `json:"dataPersistence,omitempty"`
	DataEvictionPolicy                  *string                `json:"dataEvictionPolicy,omitempty"`
	Replication                         *bool                  `json:"replication,omitempty"`
	PeriodicBackupPath                  *string                `json:"periodicBackupPath,omitempty"`
	SourceIPs                           []*string              `json:"sourceIps,omitempty"`
	Replica                             *ReplicaOf             `json:"replica,omitempty"`
	RegexRules                          []*string              `json:"regexRules,omitempty"`
	ClientTlsCertificates               []*DatabaseCertificate `json:"clientTlsCertificates,omitempty"`
	EnableTls                           *bool                  `json:"enableTls,omitempty"`
	Password                            *string                `json:"password,omitempty"`
	Alerts                              *[]*databases.Alert    `json:"alerts,omitempty"`
	// As with flexible databases, this is only available on the update endpoint
	EnableDefaultUser *bool `json:"enableDefaultUser,omitempty"`
}

Jump to

Keyboard shortcuts

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