store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Topic     string `json:"-"`
	Metrics   string `json:"metrics"`
	Value     string `json:"value"`
	Timestamp int64  `json:"updated_at"`
}

type Store

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

func NewStore

func NewStore(maxStoreTime time.Duration) *Store

NewStore returns Store struct

func (*Store) Add

func (s *Store) Add(info *Info)

Add adds new data

func (*Store) Clean

func (s *Store) Clean()

Clean remove old data from store

func (*Store) Get

func (s *Store) Get(metric string) *Info

Get return latest info data for metric

func (*Store) MarshalJSON

func (s *Store) MarshalJSON() ([]byte, error)

MarshalJSON returns serialized concurrent map struct to JSON byte slice

Jump to

Keyboard shortcuts

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