Documentation
¶
Index ¶
- type ChangeEventHandler
- type Client
- type ClientOption
- type CreateCollectionOptions
- type DefaultClient
- func (c *DefaultClient) Close() error
- func (c *DefaultClient) CreateCollection(ctx context.Context, opts *CreateCollectionOptions) error
- func (c *DefaultClient) Monitor(ctx context.Context) error
- func (c *DefaultClient) Name() string
- func (c *DefaultClient) WatchCollection(ctx context.Context, opts *WatchCollectionOptions) error
- type EventListener
- func OnChangeEventProcessingEvent(onChangeEventProcessing func(collName, subj string, duration time.Duration)) EventListener
- func OnCmdFailedEvent(onCmdFailedEvent func(dbName, cmdName string, duration time.Duration)) EventListener
- func OnCmdStartedEvent(onCmdStartedEvent func(dbName, cmdName string)) EventListener
- func OnCmdSucceededEvent(onCmdSucceededEvent func(dbName, cmdName string, duration time.Duration)) EventListener
- type WatchCollectionOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeEventHandler ¶
type Client ¶
type Client interface { server.NamedMonitor io.Closer CreateCollection(ctx context.Context, opts *CreateCollectionOptions) error WatchCollection(ctx context.Context, opts *WatchCollectionOptions) error }
type ClientOption ¶
type ClientOption func(*DefaultClient)
func WithEventListeners ¶
func WithEventListeners(listeners ...EventListener) ClientOption
func WithLogger ¶
func WithLogger(logger *slog.Logger) ClientOption
func WithMongoUri ¶
func WithMongoUri(uri string) ClientOption
type CreateCollectionOptions ¶
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
func NewDefaultClient ¶
func NewDefaultClient(opts ...ClientOption) (*DefaultClient, error)
func (*DefaultClient) Close ¶
func (c *DefaultClient) Close() error
func (*DefaultClient) CreateCollection ¶
func (c *DefaultClient) CreateCollection(ctx context.Context, opts *CreateCollectionOptions) error
func (*DefaultClient) Name ¶
func (c *DefaultClient) Name() string
func (*DefaultClient) WatchCollection ¶
func (c *DefaultClient) WatchCollection(ctx context.Context, opts *WatchCollectionOptions) error
type EventListener ¶
type EventListener func(*DefaultClient)
func OnChangeEventProcessingEvent ¶
func OnChangeEventProcessingEvent(onChangeEventProcessing func(collName, subj string, duration time.Duration)) EventListener
func OnCmdFailedEvent ¶
func OnCmdFailedEvent(onCmdFailedEvent func(dbName, cmdName string, duration time.Duration)) EventListener
func OnCmdStartedEvent ¶
func OnCmdStartedEvent(onCmdStartedEvent func(dbName, cmdName string)) EventListener
func OnCmdSucceededEvent ¶
func OnCmdSucceededEvent(onCmdSucceededEvent func(dbName, cmdName string, duration time.Duration)) EventListener
type WatchCollectionOptions ¶
Click to show internal directories.
Click to hide internal directories.