repository

package
v0.0.0-...-585816b Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureRepository

func ConfigureRepository(repo *Repository)

ConfigureRepository creates the aws-sdk client and attaches it to the provided repository.

Types

type DynamodbRepository

type DynamodbRepository struct {
	TableName string
	Cl        *dynamodb.Client
}

DynamodbRepository is the repository used for interacting with a DynamodbTable.

func (*DynamodbRepository) ListServiceCoverage

func (dr *DynamodbRepository) ListServiceCoverage() (sc []ServiceCoverage, err error)

ListServiceCoverage returns a list of all services on the Repo.

func (*DynamodbRepository) UpdateServiceCoverage

func (dr *DynamodbRepository) UpdateServiceCoverage(sc ServiceCoverage) (err error)

UpdateServiceCoverage updates the repository with the provided ServiceCoverage. If the service already exists, then the coverage is overwritten, otherwise a new item is created.

type LocalRepository

type LocalRepository struct {
	Services []ServiceCoverage
}

LocalRepository stores items in memory and can be used for debugging.

func (*LocalRepository) ListServiceCoverage

func (lr *LocalRepository) ListServiceCoverage() (sc []ServiceCoverage, err error)

ListServiceCoverage returns a list of all services on the Repo.

func (*LocalRepository) UpdateServiceCoverage

func (lr *LocalRepository) UpdateServiceCoverage(sc ServiceCoverage) (err error)

UpdateServiceCoverage updates the repository with the provided ServiceCoverage. If the service already exists, then the coverage is overwritten, otherwise a new item is created.

type Repository

type Repository interface {
	UpdateServiceCoverage(ServiceCoverage) error
	ListServiceCoverage() ([]ServiceCoverage, error)
}

Repository is an interface used for updating and listing the stored items.

type ServiceCoverage

type ServiceCoverage struct {
	ServiceName string  `json:"service_name" dynamodbav:"service_name"`
	Coverage    float32 `json:"coverage" dynamodbav:"coverage"`
}

ServiceCoverage is the schema used for the repository items.

Jump to

Keyboard shortcuts

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