Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Set = wire.NewSet( NewClient, )
Set is a Wire provider set that provides a MongoDB client.
Functions ¶
This section is empty.
Types ¶
type ChangeStream ¶
type ChangeStream struct {
// contains filtered or unexported fields
}
ChangeStream is a struct that represents a change stream.
func NewChangeStream ¶
func NewChangeStream(ctx context.Context, params ChangeStreamParams, opts ...ChangeStreamOption) (*ChangeStream, error)
NewChangeStream creates a new change stream instance.
func (*ChangeStream) Close ¶
func (c *ChangeStream) Close(ctx context.Context) error
Close closes the change stream cursor.
func (*ChangeStream) Run ¶
func (c *ChangeStream) Run(ctx context.Context)
Run starts watching change stream.
type ChangeStreamHandler ¶
type ChangeStreamHandler func(ctx context.Context, event model.ChangeEvent) error
ChangeStreamHandler is a type of handler function that handles ChangeStream.
type ChangeStreamOption ¶
type ChangeStreamOption func(opts *ChangeStreamOptions)
ChangeStreamOption is a type of option function for change stream.
func WithBatchSize ¶
func WithBatchSize(batchSize int32) ChangeStreamOption
WithBatchSize sets the batch size for ChangeStream.
type ChangeStreamOptions ¶
type ChangeStreamOptions struct {
*options.ChangeStreamOptions
}
ChangeStreamOptions is a struct that represents options for change stream.
type ChangeStreamParams ¶ added in v0.0.3
type ChangeStreamParams struct { Client *Client Handler ChangeStreamHandler Storage persistent.StorageBuffer Database string Collection string }
ChangeStreamParams is a struct that represents parameters for creating a ChangeStream.
Click to show internal directories.
Click to hide internal directories.