crdb

package
v0.0.0-...-46c8c2e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTopicName = errors.New("topic name should not contain characters matched by " + disallowedTopicCharacters.String())
View Source
var ErrPublisherClosed = errors.New("publisher is closed")
View Source
var ErrSubscriberClosed = errors.New("subscriber is closed")

Functions

func ChangeFeedQuery

func ChangeFeedQuery(topic string, resolved time.Duration, cursor time.Time) string

func InitializeClaimsSchema

func InitializeClaimsSchema(
	ctx context.Context,
	db *sql.DB,
	topic string,
	consumerGroup string,
	logger watermill.LoggerAdapter,
) error

func InitializeCursorsSchema

func InitializeCursorsSchema(
	ctx context.Context, db *sql.DB, logger watermill.LoggerAdapter,
) error

func InitializeMessageSchema

func InitializeMessageSchema(
	ctx context.Context, db *sql.DB, topic string, logger watermill.LoggerAdapter,
) error

func InitializeSessionSchema

func InitializeSessionSchema(ctx context.Context, db *sql.DB) error

func NewPublisher

func NewPublisher(conn DB, logger watermill.LoggerAdapter) *publisher

func NewSubscriber

func NewSubscriber(db *sql.DB, consumerGroup string, logger watermill.LoggerAdapter) *subscriber

Types

type CRDBEnvelope

type CRDBEnvelope struct {
	Value ResolvedTimestamp `json:"__crdb__"`
}

type DB

type DB interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
}

type PublisherConfig

type PublisherConfig struct {
	AutoInitializeSchema bool
}

type ResolvedTimestamp

type ResolvedTimestamp struct {
	Resolved string `json:"resolved"`
}

type Scanner

type Scanner interface {
	Scan(...interface{}) error
}

type Session

type Session struct {
	Start     chan struct{}
	SessionID string
	// contains filtered or unexported fields
}

func NewSession

func NewSession(db *sql.DB, logger watermill.LoggerAdapter) *Session

func (*Session) Close

func (s *Session) Close() error

func (*Session) Observe

func (s *Session) Observe(ctx context.Context, tx *sql.Tx) error

func (*Session) Run

func (s *Session) Run(ctx context.Context) error

func (*Session) TableName

func (s *Session) TableName() string

Directories

Path Synopsis
Package testutils provides testing utilities for testing watermill-crdb.
Package testutils provides testing utilities for testing watermill-crdb.

Jump to

Keyboard shortcuts

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