mongodb

package
v0.0.0-...-988e9ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, dbCfg *config.MongoDB) (*mongo.Client, error)

func NewLogRepository

func NewLogRepository(logs *mongo.Collection) database.Controller[*types.Log]

func NewTokenRepository

func NewTokenRepository(tokens *mongo.Collection) database.Controller[*types.Token]

Types

type Iterator

type Iterator[T any] struct {
	// contains filtered or unexported fields
}

func (*Iterator[T]) Chan

func (i *Iterator[T]) Chan() chan T

func (*Iterator[T]) Err

func (i *Iterator[T]) Err() error

type LogRepository

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

func (*LogRepository) Count

func (l *LogRepository) Count(ctx context.Context) (int64, error)

func (*LogRepository) Delete

func (l *LogRepository) Delete(ctx context.Context, id string) error

func (*LogRepository) Find

func (l *LogRepository) Find(ctx context.Context, query find.Query[*types.Log], options find.Options[*types.Log]) (database.Iterator[*types.Log], error)

func (*LogRepository) Get

func (l *LogRepository) Get(ctx context.Context, id string) (*types.Log, error)

func (*LogRepository) Insert

func (l *LogRepository) Insert(ctx context.Context, log *types.Log) error

func (*LogRepository) Update

func (l *LogRepository) Update(ctx context.Context, id string, updates updates.Updates[*types.Log]) error

type TokenRepository

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

func (*TokenRepository) Count

func (t *TokenRepository) Count(ctx context.Context) (int64, error)

func (*TokenRepository) Delete

func (t *TokenRepository) Delete(ctx context.Context, id string) error

func (*TokenRepository) Find

func (*TokenRepository) Get

func (t *TokenRepository) Get(ctx context.Context, id string) (*types.Token, error)

func (*TokenRepository) Insert

func (t *TokenRepository) Insert(ctx context.Context, msg *types.Token) error

func (*TokenRepository) Update

func (t *TokenRepository) Update(ctx context.Context, id string, updates updates.Updates[*types.Token]) error

Jump to

Keyboard shortcuts

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