db

package
v0.0.0-...-6fdbc3c Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Name     string          // the name of the db (typically matches network name)
	Ctx      ctx.Context     // calling context
	Client   *mongo.Client   // mongo connection
	Accounts *mongo.Database // client account store
	Node     *mongo.Database // node identifiers
}

DB encapsulates a mongo connection for persistent storage

func (*DB) Close

func (d *DB) Close() error

Close terminates an existing mongo connection

func (*DB) Open

func (d *DB) Open(uri string) error

Open initiates a new mongo connection

type Service

type Service struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"`
	CreatedAt   time.Time          `bson:"created_at,omitempty"`
	UpdatedAt   time.Time          `bson:"updated_at,omitempty"`
	QueryType   int                `bson:"query_type"`
	Query       []byte             `bson:"query"`
	QueryDigest []byte             `bson:"query_digest"`
}

Service represents a generic service type

Jump to

Keyboard shortcuts

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