mongodb

package
v0.0.0-...-ace0ea9 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const COLL = "events"
View Source
const DB = "dbevent"

Variables

This section is empty.

Functions

func MakeQueryBSON

func MakeQueryBSON(params audit.QueryParams) bson.M

Types

type InsertDoc

type InsertDoc struct {
	Type      string                 `bson:"type"`
	Consumer  string                 `bson:"consumer"`
	Payload   map[string]interface{} `bson:"payload,inline,omitempty"`
	CreatedAt time.Time              `bson:"created_at"`
}

func MakeInsertDoc

func MakeInsertDoc(event audit.EventBase) (doc InsertDoc)

type Repo

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

func MakeMongoRepo

func MakeMongoRepo(mongoUri string) *Repo

func (*Repo) Close

func (r *Repo) Close()

func (*Repo) FindEvents

func (r *Repo) FindEvents(ctx context.Context, params audit.QueryParams) ([]audit.Event, error)

func (*Repo) InsertEvent

func (r *Repo) InsertEvent(ctx context.Context, event audit.EventBase) (audit.ID, error)

Jump to

Keyboard shortcuts

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