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"` PhylaxAddr string `bson:"phylaxaddr" json:"phylaxAddr"` 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.
Click to show internal directories.
Click to hide internal directories.