mongodb

package
v0.0.0-...-9d65b0f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoRepository

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

MongoRepository implements the application.Repository interface

func NewMongoRepository

func NewMongoRepository(uri, database, collection string) (*MongoRepository, error)

NewMongoRepository creates a new MongoDB repository instance

func (*MongoRepository) Close

func (r *MongoRepository) Close(ctx context.Context) error

Close implements the Close method required by the Repository interface

func (*MongoRepository) CreateReport

func (r *MongoRepository) CreateReport(ctx context.Context, report *domain.Report) error

CreateReport implements ReportsRepository.CreateReport

func (*MongoRepository) GetReport

func (r *MongoRepository) GetReport(ctx context.Context, id string) (*domain.Report, error)

GetReport implements ReportsRepository.GetReport

func (*MongoRepository) GetTopIPs

GetTopIPs implements StatisticsRepository.GetTopIPs

func (*MongoRepository) GetTopViolatedDirectives

func (r *MongoRepository) GetTopViolatedDirectives(ctx context.Context) ([]application.TopDirectiveResult, error)

GetTopViolatedDirectives implements StatisticsRepository.GetTopViolatedDirectives

func (*MongoRepository) ListReports

func (r *MongoRepository) ListReports(ctx context.Context) ([]domain.Report, error)

ListReports implements ReportsRepository.ListReports

Jump to

Keyboard shortcuts

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