repository

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	// 获取复制槽的消费者要求的最旧WAL地址
	GetSlotLSN(slotName string) (string, error)
	// 检查发布是否存在
	PublicationIsExists(pubName string) (bool, error)
	// 创建发布
	CreatePublication(pubName string) error
	// 检查数据库连接是否正常
	IsAlive() bool
	// 关闭数据库链接
	Close() error
}

Repository 数据库接口

type RepositoryImpl

type RepositoryImpl struct {
	// contains filtered or unexported fields
}

RepositoryImpl service repository.

func New

func New(conn *pgx.Conn) *RepositoryImpl

New returns a new instance of the repository.

func (RepositoryImpl) Close

func (r RepositoryImpl) Close() error

Close database connection.

func (RepositoryImpl) CreatePublication

func (r RepositoryImpl) CreatePublication(pubName string) error

CreatePublication 创建发布

func (RepositoryImpl) GetSlotLSN

func (r RepositoryImpl) GetSlotLSN(slotName string) (string, error)

GetSlotLSN returns the value of the last offset for a specific slot.

func (RepositoryImpl) IsAlive

func (r RepositoryImpl) IsAlive() bool

IsAlive check database connection problems.

func (RepositoryImpl) PublicationIsExists

func (r RepositoryImpl) PublicationIsExists(pubName string) (bool, error)

PublicationIsExists 检查发布是否存在

Jump to

Keyboard shortcuts

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