repositories

package
v0.0.0-...-11dc556 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedDbRepository

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

func NewCachedRepository

func NewCachedRepository(prometheus *ginprom.Prometheus, wrapped DbRepository) *CachedDbRepository

func (*CachedDbRepository) CountAll

func (repo *CachedDbRepository) CountAll(ctx context.Context, criteria *openapi.SearchRequest) (int64, error)

CountAll implements DbRepository.

func (*CachedDbRepository) FacetCounts

func (repo *CachedDbRepository) FacetCounts(ctx context.Context, criteria *openapi.SearchRequest, facetField string, limit int32) (*map[string]int64, error)

FacetCounts implements DbRepository.

func (*CachedDbRepository) FindByObjectID

func (repo *CachedDbRepository) FindByObjectID(ctx context.Context, objectID string) (*openapi.RouteMetadata, error)

FindByObjectID implements DbRepository.

func (*CachedDbRepository) SearchHits

func (repo *CachedDbRepository) SearchHits(ctx context.Context, criteria *openapi.SearchRequest) (*[]openapi.RouteSummary, error)

SearchHits implements DbRepository.

func (*CachedDbRepository) Store

func (repo *CachedDbRepository) Store(ctx context.Context, route *openapi.RouteMetadata) error

Store implements DbRepository.

type DbRepository

type DbRepository interface {
	Store(ctx context.Context, route *model.RouteMetadata) error
	FindByObjectID(ctx context.Context, objectID string) (*model.RouteMetadata, error)
	CountAll(ctx context.Context, criteria *model.SearchRequest) (int64, error)
	SearchHits(ctx context.Context, criteria *model.SearchRequest) (*[]model.RouteSummary, error)
	FacetCounts(ctx context.Context, criteria *model.SearchRequest, facetField string, limit int32) (*map[string]int64, error)
}

type MongoDbRepository

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

func NewMongoRouteRepository

func NewMongoRouteRepository(client *mongo.Client, dbName, collectionName string) *MongoDbRepository

func (*MongoDbRepository) CountAll

func (repo *MongoDbRepository) CountAll(ctx context.Context, criteria *model.SearchRequest) (int64, error)

func (*MongoDbRepository) FacetCounts

func (repo *MongoDbRepository) FacetCounts(ctx context.Context, criteria *model.SearchRequest, facetField string, limit int32) (*map[string]int64, error)

func (*MongoDbRepository) FindByObjectID

func (repo *MongoDbRepository) FindByObjectID(ctx context.Context, objectID string) (*model.RouteMetadata, error)

func (*MongoDbRepository) SearchHits

func (repo *MongoDbRepository) SearchHits(ctx context.Context, criteria *model.SearchRequest) (*[]model.RouteSummary, error)

func (*MongoDbRepository) Store

func (repo *MongoDbRepository) Store(ctx context.Context, route *model.RouteMetadata) error

type PostgresDbRepository

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

func NewPostgresRouteRepository

func NewPostgresRouteRepository(pool *pgxpool.Pool, schema string) *PostgresDbRepository

func (*PostgresDbRepository) CountAll

func (repo *PostgresDbRepository) CountAll(ctx context.Context, criteria *model.SearchRequest) (int64, error)

func (*PostgresDbRepository) FacetCounts

func (repo *PostgresDbRepository) FacetCounts(ctx context.Context, criteria *model.SearchRequest, facetField string, limit int32) (*map[string]int64, error)

func (*PostgresDbRepository) FindByObjectID

func (repo *PostgresDbRepository) FindByObjectID(ctx context.Context, objectID string) (*model.RouteMetadata, error)

func (*PostgresDbRepository) SearchHits

func (repo *PostgresDbRepository) SearchHits(ctx context.Context, criteria *model.SearchRequest) (*[]model.RouteSummary, error)

func (*PostgresDbRepository) Store

func (repo *PostgresDbRepository) Store(ctx context.Context, route *model.RouteMetadata) error

Jump to

Keyboard shortcuts

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