Documentation ¶
Index ¶
- Constants
- func AlterTableReplicaIdentityFull(tbl string) string
- func CheckWhetherReplayLSNIsAdvanced(ctx context.Context, conn *Conn, currentLSN string) (string, bool, error)
- func CountRecordsInTablesQuery(tableName string) string
- func CreateExtensionQuery(ext string) string
- func CreateFlareStatusTable(ctx context.Context, conn *Conn) error
- func CreatePublicationQuery(pubname string) string
- func CreateSubscriptionQuery(subName, connInfo, pubName string) string
- func CreateTestTable(ctx context.Context, baseDSN, appUser string, dropDBBefore bool) error
- func DeleteReplicationStatus(ctx context.Context, conn *Conn, sysID string) error
- func DropPublicationQuery(pubName string) string
- func DropSubscriptionQuery(subName string) string
- func DumpRoles(ui UserInfo, noPasswords bool) (string, error)
- func DumpSchema(ui UserInfo, db string) (string, error)
- func GetCurrentLSN(ctx context.Context, conn *Conn) (string, error)
- func GrantAllOnAllTablesQuery(role string) string
- func GrantAllOnDatabaseQuery(dbName, role string) string
- func GrantConnectQuery(dbName, user string) string
- func GrantConnectionQuery(dbName string) string
- func GrantCreateQuery(dbName, user string) string
- func ListInstalledExtensions(ctx context.Context, conn *Conn) ([]string, error)
- func PGDump(args PSQLArgs, db string) (string, error)
- func PGDumpAll(args PSQLArgs) (string, error)
- func PSQL(args PSQLArgs, db string, r io.Reader) (string, string, error)
- func ReadReplicationStatus(ctx context.Context, conn *Conn, sysID, uuid string) error
- func RevokeConnectionQuery(dbName string) string
- func StripRoleOptionsForRDS(roles string) (string, error)
- func WriteReplicationStatus(ctx context.Context, conn *Conn, sysID, uuid string) error
- type Config
- type Conn
- type ConnConfig
- type DatabaseConn
- type Host
- type HostInfo
- type Hosts
- type PSQLArgs
- type Publication
- type ReplicationSlot
- type ReplicationStat
- type Subscription
- type SubscriptionStat
- type SystemIdentifierError
- type TrafficGenerator
- type UserInfo
Constants ¶
View Source
const KillConnectionQuery = `` /* 172-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func CreateExtensionQuery ¶
func CreatePublicationQuery ¶
func CreateSubscriptionQuery ¶
func CreateTestTable ¶
func DeleteReplicationStatus ¶
func DropPublicationQuery ¶
func DropSubscriptionQuery ¶
func GrantAllOnDatabaseQuery ¶
func GrantConnectQuery ¶
func GrantConnectionQuery ¶
func GrantCreateQuery ¶
func ListInstalledExtensions ¶
func ReadReplicationStatus ¶
func RevokeConnectionQuery ¶
func StripRoleOptionsForRDS ¶
Types ¶
type Config ¶
type Config struct { Hosts Hosts `yaml:"hosts"` Publications map[string]Publication `yaml:"publications"` Subscriptions map[string]Subscription `yaml:"subscriptions"` }
func ParseConfig ¶
type Conn ¶
type Conn struct { *pgx.Conn // contains filtered or unexported fields }
Conn wraps *pgx.Conn to provider additional features on top of it.
func ConnectWithVerify ¶
func (*Conn) GetSystemIdentifier ¶
type ConnConfig ¶
type ConnConfig struct { SuperUser string `yaml:"superuser" validate:"required"` SuperUserPassword string `yaml:"superuser_password" validate:"required"` DBOwner string `yaml:"db_owner" validate:"required"` DBOwnerPassword string `yaml:"db_owner_password" validate:"required"` ReplicationUser string `yaml:"repl_user"` ReplicationUserPassword string `yaml:"repl_user_password"` Host string `yaml:"host" validate:"required"` HostViaSubscriber string `yaml:"host_via_subscriber"` Port string `yaml:"port" validate:"required"` PortViaSubscriber string `yaml:"port_via_subscriber"` SystemIdentifier string `yaml:"system_identifier" validate:"required"` }
func (ConnConfig) DBOwnerInfo ¶
func (c ConnConfig) DBOwnerInfo() UserInfo
func (ConnConfig) GetHostInfo ¶
func (c ConnConfig) GetHostInfo() HostInfo
func (ConnConfig) ReplicationUserInfo ¶
func (c ConnConfig) ReplicationUserInfo() UserInfo
func (ConnConfig) SuperUserInfo ¶
func (c ConnConfig) SuperUserInfo() UserInfo
type DatabaseConn ¶
type DatabaseConn struct { DatabaseName string PID string UserName zeronull.Text ApplicationName string ClientAddr zeronull.Text BackendStart time.Time WaitEvent zeronull.Text WaitEventType zeronull.Text State zeronull.Text }
type Host ¶
type Host struct {
Conn ConnConfig `yaml:"conn"`
}
type Publication ¶
type ReplicationSlot ¶
type ReplicationSlot struct { SlotName string Plugin string SlotType string Database string Temporary string Active string ConfirmedFlushLSN zeronull.Text }
type ReplicationStat ¶
type ReplicationStat struct { PID string UserName string ApplicationName zeronull.Text ClientAddr zeronull.Text BackendStart time.Time State zeronull.Text SentLSN zeronull.Text ReplayLSN zeronull.Text }
type Subscription ¶
type SubscriptionStat ¶
type SubscriptionStat struct { SubID string SubName string PID zeronull.Text ReceivedLSN zeronull.Text LastMsgSendTime zeronull.Timestamp LastMsgReceiptTime zeronull.Timestamp LatestEndLSN zeronull.Text LatestEndTime zeronull.Timestamp }
type SystemIdentifierError ¶
func (SystemIdentifierError) Error ¶
func (e SystemIdentifierError) Error() string
type TrafficGenerator ¶
type TrafficGenerator struct {
// contains filtered or unexported fields
}
func NewTrafficGenerator ¶
func NewTrafficGenerator(pool *pgxpool.Pool, name string) *TrafficGenerator
func (*TrafficGenerator) KeepAlive ¶
func (g *TrafficGenerator) KeepAlive(ctx context.Context) error
func (*TrafficGenerator) SendHeartBeat ¶
func (g *TrafficGenerator) SendHeartBeat(ctx context.Context) error
func (*TrafficGenerator) WriteNewItem ¶
func (g *TrafficGenerator) WriteNewItem(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.