utils

package
v0.1.0-beta-test-sign-key Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableInstanceTypes

func AvailableInstanceTypes() []string

func GetInstanceName

func GetInstanceName(ctx context.Context, apiClient MongoDBFlexClient, projectId, instanceId string) (string, error)

func GetInstanceReplicas

func GetInstanceReplicas(instanceType string) (int64, error)

func GetInstanceType

func GetInstanceType(numReplicas int64) (string, error)

func GetLatestMongoDBVersion

func GetLatestMongoDBVersion(ctx context.Context, apiClient MongoDBFlexClient, projectId string) (string, error)

func GetUserName

func GetUserName(ctx context.Context, apiClient MongoDBFlexClient, projectId, instanceId, userId string) (string, error)

func LoadFlavorId

func LoadFlavorId(cpu, ram int64, flavors *[]mongodbflex.HandlersInfraFlavor) (*string, error)

func ValidateFlavorId

func ValidateFlavorId(flavorId string, flavors *[]mongodbflex.HandlersInfraFlavor) error

func ValidateStorage

func ValidateStorage(storageClass *string, storageSize *int64, storages *mongodbflex.ListStoragesResponse, flavorId string) error

Types

type MongoDBFlexClient

type MongoDBFlexClient interface {
	ListVersionsExecute(ctx context.Context, projectId string) (*mongodbflex.ListVersionsResponse, error)
	GetInstanceExecute(ctx context.Context, projectId, instanceId string) (*mongodbflex.GetInstanceResponse, error)
	GetUserExecute(ctx context.Context, projectId, instanceId, userId string) (*mongodbflex.GetUserResponse, error)
}

Jump to

Keyboard shortcuts

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