Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Operation
- type Operations
- type Publication
- func (c *Publication) AlterTableReplicaIdentity(ctx context.Context, t Table) error
- func (c *Publication) Create(ctx context.Context) (*Config, error)
- func (c *Publication) GetReplicaIdentities(ctx context.Context) ([]Table, error)
- func (c *Publication) Info(ctx context.Context) (*Config, error)
- func (c *Publication) SetReplicaIdentities(ctx context.Context) error
- type Table
- type Tables
Constants ¶
View Source
const ( ReplicaIdentityFull = "FULL" ReplicaIdentityDefault = "DEFAULT" )
Variables ¶
View Source
var ( ErrorTablesNotExists = goerrors.New("table is not exists") ReplicaIdentityOptions = []string{ReplicaIdentityDefault, ReplicaIdentityFull} ReplicaIdentityMap = map[string]string{ "d": ReplicaIdentityDefault, "f": ReplicaIdentityFull, } )
View Source
var (
ErrorPublicationIsNotExists = goerrors.New("publication is not exists")
)
View Source
var OperationOptions = Operations{"INSERT", "UPDATE", "DELETE", "TRUNCATE"}
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `json:"name" yaml:"name"` Operations Operations `json:"operations" yaml:"operations"` Tables Tables `json:"tables" yaml:"tables"` CreateIfNotExists bool `json:"createIfNotExists" yaml:"createIfNotExists"` }
type Operations ¶
type Operations []Operation
func (Operations) String ¶
func (ops Operations) String() string
func (Operations) Validate ¶
func (ops Operations) Validate() error
type Publication ¶
type Publication struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config, conn pq.Connection) *Publication
func (*Publication) AlterTableReplicaIdentity ¶
func (c *Publication) AlterTableReplicaIdentity(ctx context.Context, t Table) error
func (*Publication) GetReplicaIdentities ¶
func (c *Publication) GetReplicaIdentities(ctx context.Context) ([]Table, error)
func (*Publication) SetReplicaIdentities ¶
func (c *Publication) SetReplicaIdentities(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.