mongodb

package
v0.0.0-...-24a8c69 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, cfg database.Config, logger *zap.Logger) storage.Twitter

Init returns a new mongodb twitter storage.

Types

type MongoDB

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

MongoDB wraps database access.

func (*MongoDB) AddTweets

func (mng *MongoDB) AddTweets(ctx context.Context, user string, tweets storage.Tweets) error

AddTweets stores tweets to the database.

func (*MongoDB) Close

func (mng *MongoDB) Close(ctx context.Context)

Close closes the database connection.

func (*MongoDB) Tweets

func (mng *MongoDB) Tweets(ctx context.Context, user string, opts storage.TweetsOptions) (storage.Tweets, error)

Tweets returns tweets from the database.

Jump to

Keyboard shortcuts

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