heartbeats

package
v0.0.0-...-ce1b770 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeartbeatDoc

type HeartbeatDoc struct {
	ID            string             `bson:"_id" json:"id"`
	BootTimestamp int64              `bson:"boottimestamp" json:"bootTimestamp"`
	Counter       int64              `bson:"counter" json:"counter"`
	Features      []string           `bson:"features" json:"features"`
	GuardianAddr  string             `bson:"guardianaddr" json:"guardianAddr"`
	IndexedAt     *time.Time         `bson:"indexedAt" json:"indexedAt"`
	NodeName      string             `bson:"nodename" json:"nodeName"`
	Timestamp     int64              `bson:"timestamp" json:"timestamp"`
	UpdatedAt     *time.Time         `bson:"updatedAt" json:"updatedAt"`
	Version       string             `bson:"version" json:"version"`
	Networks      []HeartbeatNetwork `bson:"networks" json:"networks"`
}

HeartbeatDoc represent an heartbeat document.

type HeartbeatNetwork

type HeartbeatNetwork struct {
	ID              int64  `bson:"id" json:"id"`
	Height          int64  `bson:"height" json:"height"`
	ContractAddress string `bson:"contractaddress" json:"contractAddress"`
	ErrorCount      int64  `bson:"errorcount" json:"errorCount"`
}

HeartbeatNetwork definition.

type Repository

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

Repository definition.

func NewRepository

func NewRepository(db *mongo.Database, logger *zap.Logger) *Repository

NewRepository create a new Repository.

func (*Repository) FindByIDs

func (r *Repository) FindByIDs(ctx context.Context, ids []string) ([]*HeartbeatDoc, error)

FindByIDS get a list of HeartbeatDoc pointer.

type Service

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

Service definition.

func NewService

func NewService(dao *Repository, logger *zap.Logger) *Service

NewService create a new Service.

func (*Service) GetHeartbeatsByIds

func (s *Service) GetHeartbeatsByIds(ctx context.Context, heartbeatsIDs []string) ([]*HeartbeatDoc, error)

GetHeartbeatsByIds get heartbeats by IDs.

Jump to

Keyboard shortcuts

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