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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ValueAllTime is the all time relevance statistics value for the time span key in the database.
	ValueAllTime = "all_time"
)

Variables

This section is empty.

Functions

func Init

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

Init returns a new mongodb twitter storage.

Types

type MongoDB

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

MongoDB wraps database access.

func (*MongoDB) Close

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

Close closes the database connection.

func (*MongoDB) Relevance

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

Relevance returns a relevance from the database.

func (*MongoDB) UpdateRelevances

func (mng *MongoDB) UpdateRelevances(
	ctx context.Context,
	user string,
	relevances storage.Relevances,
) error

UpdateRelevances updates the relevances into the database.

Jump to

Keyboard shortcuts

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