db

package
v0.0.0-...-15c5a81 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricDataModel

type MetricDataModel struct {
	Id        string `json:"id,omitempty"`
	Key       string `json:"key,omitempty"`
	Value     int    `json:"value,omitempty"`
	EntryTime string `json:"entry_time,omitempty"`
}

---- MetricDataModel ----

type MetricService

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

---- MetricService ----

func NewMetricService

func NewMetricService(config configuration.Configuration, db *TestDataCache) *MetricService

---- NewMetricService -----

func (*MetricService) AddMetric

func (rcvr *MetricService) AddMetric(m root.Metric) (root.Metric, error)

---- MetricService.AddMetric ----

func (*MetricService) CanCount

func (rcvr *MetricService) CanCount(m root.Metric) bool

func (*MetricService) ClearOutdatedMetrics

func (rcvr *MetricService) ClearOutdatedMetrics(key string) error

---- MetricService.ClearOutDatedMetrics ----

func (*MetricService) GetMetrics

func (rcvr *MetricService) GetMetrics() ([]root.Metric, error)

---- MetricService.GetMetrics ----

func (*MetricService) ShowActiveMetrics

func (rcvr *MetricService) ShowActiveMetrics() ([]root.Metric, error)

---- MetricService.ShowActiveMetrics ----

func (*MetricService) SumMetrics

func (rcvr *MetricService) SumMetrics(key string) (root.MetricSum, error)

---- MetricService.SumMetrics ----

type TestDataCache

type TestDataCache struct {
	MetricData []*MetricDataModel
}

--- TestDataCache ----

func NewTestDataCache

func NewTestDataCache(td []*MetricDataModel) *TestDataCache

---- NewTestDataCache ----

func (*TestDataCache) DelMetric

func (tc *TestDataCache) DelMetric(id string) error

---- DelMetric ----

func (*TestDataCache) GetMetric

func (tc *TestDataCache) GetMetric(id string) (*MetricDataModel, error)

---- GetMetric ----

func (*TestDataCache) GetMetricData

func (tc *TestDataCache) GetMetricData() []*MetricDataModel

---- GetMetricData ----

func (*TestDataCache) PostMetric

func (tc *TestDataCache) PostMetric(td *MetricDataModel)

---- PostMetric -----

Jump to

Keyboard shortcuts

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