database

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentDao

type AgentDao struct {
	ID        primitive.ObjectID `bson:"_id"`
	AgentName string             `bson:"agentName,omitempty"`
	Status    apiPb.AgentStatus  `bson:"status"`
	HostInfo  *HostInfo          `bson:"hostInfo,omitempty"`
	History   []*HistoryItem     `bson:"history"`
	Interval  int64              `bson:"interval"`
}

type Database

type Database interface {
	Add(ctx context.Context, agent *apiPb.RegisterRequest) (string, error)
	UpdateStatus(ctx context.Context, agentID primitive.ObjectID, status apiPb.AgentStatus, time *timestamp.Timestamp) error
	GetAll(ctx context.Context, filter bson.M) ([]*apiPb.AgentItem, error)
	GetByID(ctx context.Context, id primitive.ObjectID) (*apiPb.AgentItem, error)
}

func New

func New(connector mongo_helper.Connector) Database

type HistoryItem

type HistoryItem struct {
	Status    apiPb.AgentStatus `bson:"status"`
	Timestamp time.Time         `bson:"time"`
}

type HostInfo

type HostInfo struct {
	HostName     string        `bson:"hostName,omitempty"`
	Os           string        `bson:"os,omitempty"`
	PlatFormInfo *PlatFormInfo `bson:"platFormInfo,omitempty"`
}

type PlatFormInfo

type PlatFormInfo struct {
	Name    string `bson:"name,omitempty"`
	Family  string `bson:"family,omitempty"`
	Version string `bson:"version,omitempty"`
}

Jump to

Keyboard shortcuts

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