Documentation ¶
Index ¶
- Constants
- Variables
- func Init(provider ResolverFactory)
- func ResolveHostPortWithOverride(host string, port uint16) (string, uint16, error)
- type ClusterHost
- type Health
- type HostResolver
- type InstanceType
- type PasswordResolver
- type ProviderType
- type ReplicaType
- type ResolverFactory
- type Role
- type ShardGroupHostsResolver
- type ShardResolver
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 ¶
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 HostResolver ¶
type HostResolver interface {
ResolveHosts() ([]ClusterHost, error)
}
type InstanceType ¶
type InstanceType string
type PasswordResolver ¶
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 ShardGroupHostsResolver ¶
type ShardGroupHostsResolver interface {
ResolveShardGroupHosts(shardGroup string) ([]ClusterHost, error)
}
type ShardResolver ¶
Click to show internal directories.
Click to hide internal directories.