dbaas

package
v0.0.0-rc13 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReplicaTypeSync    = ReplicaType("SYNC")
	ReplicaTypeAsync   = ReplicaType("ASYNC")
	ReplicaTypeUnknown = ReplicaType("UNKNOWN")
)
View Source
const (
	InstanceTypeUnspecified = InstanceType("")
	InstanceTypeClickhouse  = InstanceType("CLICKHOUSE")
	InstanceTypeMongod      = InstanceType("MONGOD")
	InstanceTypeMongos      = InstanceType("MONGOS")
	InstanceTypeMongoinfra  = InstanceType("MONGOINFRA")
	InstanceTypeMongocfg    = InstanceType("MONGOCFG")
)
View Source
const (
	MASTER  = Role("MASTER")
	REPLICA = Role("REPLICA")
	ANY     = Role("ANY")
	KAFKA   = Role("KAFKA")
)
View Source
const (
	ALIVE = Health("ALIVE")
)

Variables

View Source
var (
	ProviderTypeMysql         = ProviderType("managed-mysql")
	ProviderTypeKafka         = ProviderType("managed-kafka")
	ProviderTypePostgresql    = ProviderType("managed-postgresql")
	ProviderTypeMongodb       = ProviderType("managed-mongodb")
	ProviderTypeClickhouse    = ProviderType("managed-clickhouse")
	ProviderTypeGreenplum     = ProviderType("managed-greenplum")
	ProviderTypeElasticSearch = ProviderType("managed-elasticsearch")
	ProviderTypeOpenSearch    = ProviderType("managed-opensearch")
)
View Source
var NotSupported = xerrors.NewSentinel("resolver not supported")

Functions

func Init

func Init(provider ResolverFactory)

func ResolveHostPortWithOverride

func ResolveHostPortWithOverride(host string, port uint16) (string, uint16, error)

ResolveHostPortWithOverride - function which determines real port If port present in 'host' string - it overrides 'port' from config At least it's very useful for testing - you can to upraise locally pgHA installation And it also can be useful for any user, who has postgres servers on >1 port It can be used with any HA installation - for now it's used only with pg

Types

type ClusterHost

type ClusterHost struct {
	Name        string       `json:"name"`
	ClusterID   string       `json:"clusterId"`
	ShardName   string       `json:"shardName"`
	Type        InstanceType `json:"type"`
	Role        Role         `json:"role"`
	Health      Health       `json:"health"`
	ReplicaType ReplicaType  `json:"replicaType"`
}

func ResolveClusterHosts

func ResolveClusterHosts(typ ProviderType, cluster string) ([]ClusterHost, error)

type Health

type Health string

type HostResolver

type HostResolver interface {
	ResolveHosts() ([]ClusterHost, error)
}

type InstanceType

type InstanceType string

type PasswordResolver

type PasswordResolver interface {
	ResolvePassword() (string, error)
}

type ProviderType

type ProviderType string

type ReplicaType

type ReplicaType string

type ResolverFactory

type ResolverFactory interface {
	HostResolver(typ ProviderType, clusterID string) (HostResolver, error)
	PasswordResolver(typ ProviderType, clusterID string) (PasswordResolver, error)
	ShardResolver(typ ProviderType, clusterID string) (ShardResolver, error)
	ShardGroupHostsResolver(typ ProviderType, clusterID string) (ShardGroupHostsResolver, error)
}

func Current

func Current() (ResolverFactory, error)

type Role

type Role string

type ShardGroupHostsResolver

type ShardGroupHostsResolver interface {
	ResolveShardGroupHosts(shardGroup string) ([]ClusterHost, error)
}

type ShardResolver

type ShardResolver interface {
	Sharded() (bool, error)
}

Jump to

Keyboard shortcuts

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