Documentation ¶
Index ¶
- type Input
- type Output
- type Repository
- type RepositoryInMemory
- func (r *RepositoryInMemory) DeleteByID(id string) error
- func (r *RepositoryInMemory) FindAll() (*[]domain.Benchmark, error)
- func (r *RepositoryInMemory) InsertOne(benchmark *domain.Benchmark) error
- func (r *RepositoryInMemory) UpdateBenchmarkCompleted(id string, output *domain.BenchmarkOutput) error
- type Service
- func (s *Service) AggregateApplicationState(pipeline mongo.Pipeline) (*[]bson.M, error)
- func (s *Service) BulkRun(inputs []Input, c chan domain.BenchmarkResult)
- func (s *Service) Create(input domain.BenchmarkInput) (*domain.Benchmark, error)
- func (s *Service) DeleteByID(id string) error
- func (s *Service) FindAll() (*[]domain.Benchmark, error)
- func (s *Service) GetDataSources() map[string]map[string]string
- func (s *Service) HandleBenchmark(benchmark *domain.Benchmark) error
- func (s *Service) Run(input Input, benchmarkID *primitive.ObjectID) (*Output, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository stores and returns benchmarks documents
func NewRepository ¶
func NewRepository(repo domain.Repository) *Repository
NewRepository returns an instance of benchmark repository
func (*Repository) DeleteByID ¶
func (r *Repository) DeleteByID(id string) error
DeleteByID deletes one benchmark
func (*Repository) FindAll ¶
func (r *Repository) FindAll() (*[]domain.Benchmark, error)
FindAll returns every benchmark
func (*Repository) InsertOne ¶
func (r *Repository) InsertOne(benchmark *domain.Benchmark) error
InsertOne creates one benchmark
func (*Repository) UpdateBenchmarkCompleted ¶
func (r *Repository) UpdateBenchmarkCompleted(id string, output *domain.BenchmarkOutput) error
UpdateBenchmarkCompleted updates one benchmark
type RepositoryInMemory ¶
RepositoryInMemory stores benchmarks in memory
func NewRepositoryInMemory ¶
func NewRepositoryInMemory() *RepositoryInMemory
NewRepositoryInMemory returns an instance of RepositoryInMemory
func (*RepositoryInMemory) DeleteByID ¶
func (r *RepositoryInMemory) DeleteByID(id string) error
DeleteByID removes a benchmark from store
func (*RepositoryInMemory) FindAll ¶
func (r *RepositoryInMemory) FindAll() (*[]domain.Benchmark, error)
FindAll returns all benchmarks stored
func (*RepositoryInMemory) InsertOne ¶
func (r *RepositoryInMemory) InsertOne(benchmark *domain.Benchmark) error
InsertOne creates a benchmark and stores it in a data structure
func (*RepositoryInMemory) UpdateBenchmarkCompleted ¶
func (r *RepositoryInMemory) UpdateBenchmarkCompleted(id string, output *domain.BenchmarkOutput) error
UpdateBenchmarkCompleted updates benchmark status
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a service with all methods to interact with benchmark related functions
func NewService ¶
func NewService(repo domain.BenchmarksRepository, assetpriceRepository domain.AssetPriceRepository, applicationExecutionStatesRepository domain.ApplicationExecutionStateRepository) *Service
NewService returns an instance of Service
func (*Service) AggregateApplicationState ¶
AggregateApplicationState returns an aggregate of application state
func (*Service) BulkRun ¶
func (s *Service) BulkRun(inputs []Input, c chan domain.BenchmarkResult)
BulkRun runs multiple benchmarks concurrently
func (*Service) DeleteByID ¶
DeleteByID removes one benchmark from database
func (*Service) GetDataSources ¶
GetDataSources returns all available data sources
func (*Service) HandleBenchmark ¶
HandleBenchmark executes benchmark and updates database accordingly