Documentation ¶
Index ¶
- Variables
- func AddEngine(ctx context.Context, source *config.Database, log logger.Logger) error
- func GetEngine[T GlobalExecutor](engine config.Engine) T
- type Cursor
- type GlobalExecutor
- type Mongo
- func (m *Mongo) AddCollection(col string)
- func (m *Mongo) Close() error
- func (m *Mongo) Count(ctx context.Context, col string) (int64, error)
- func (m *Mongo) FindLimit(ctx context.Context, limit int64, col string) (Cursor, error)
- func (m *Mongo) FindOne(ctx context.Context, filter interface{}, col string) (Result, error)
- func (m *Mongo) Watcher(ctx context.Context, col string) (<-chan func() (wType WatcherType, res WatchResult), error)
- type MongoExecutor
- type Result
- type SQL
- type SQLExecutor
- type WatchResult
- type WatcherType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEngineNotSupported = errors.New("database not engine supported")
Functions ¶
func GetEngine ¶
func GetEngine[T GlobalExecutor](engine config.Engine) T
Types ¶
type GlobalExecutor ¶
type GlobalExecutor interface {
Close() error
}
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
func (*Mongo) AddCollection ¶
func (*Mongo) Watcher ¶
func (m *Mongo) Watcher(ctx context.Context, col string) (<-chan func() (wType WatcherType, res WatchResult), error)
type MongoExecutor ¶
type MongoExecutor interface { GlobalExecutor AddCollection(col string) Count(ctx context.Context, col string) (int64, error) FindOne(ctx context.Context, filter interface{}, col string) (Result, error) FindLimit(ctx context.Context, limit int64, col string) (Cursor, error) Watcher(ctx context.Context, col string) (<-chan func() (WatcherType, WatchResult), error) }
type SQL ¶ added in v0.3.0
type SQL struct {
// contains filtered or unexported fields
}
type SQLExecutor ¶ added in v0.3.0
type WatchResult ¶
type WatcherType ¶
type WatcherType uint8
const ( Null WatcherType = iota OnInsert OnUpdate OnDelete OnReplace )
func (WatcherType) String ¶
func (w WatcherType) String() string
Click to show internal directories.
Click to hide internal directories.