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 ¶
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.