model

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectInfo

type CollectInfo struct {
	ProjectName   string                 `json:"project_name" yaml:"project_name"`
	Record        map[string]interface{} `json:"record" yaml:"record"`
	Labels        []string               `json:"labels" yaml:"labels"`
	DiagnosisTask map[string]interface{} `json:"diagnosis_task" yaml:"diagnosis_task"`
	Cut           *CollectInfoCut        `json:"cut" yaml:"cut"`
	Moments       []CollectInfoMoment    `json:"moments" yaml:"moments"`
	Skip          bool                   `json:"skip" yaml:"skip"`

	// id field does not need to be serialized
	Id string `json:"-" yaml:"-"`
}

func (*CollectInfo) Clean

func (ci *CollectInfo) Clean() string

func (*CollectInfo) GetFilePath

func (ci *CollectInfo) GetFilePath() string

func (*CollectInfo) Load

func (ci *CollectInfo) Load(id string) error

func (*CollectInfo) Save

func (ci *CollectInfo) Save() error

type CollectInfoCut

type CollectInfoCut struct {
	ExtraFiles []string `json:"extra_files" yaml:"extra_files"`
	Start      int64    `json:"start" yaml:"start"` // timestamp in seconds
	End        int64    `json:"end" yaml:"end"`     // timestamp in seconds
	WhiteList  []string `json:"white_list" yaml:"white_list"`
}

type CollectInfoMoment

type CollectInfoMoment struct {
	Title        string            `json:"title" yaml:"title"`
	Description  string            `json:"description" yaml:"description"`
	Timestamp    float64           `json:"timestamp" yaml:"timestamp"`
	StartTime    float64           `json:"start_time" yaml:"start_time"`
	CustomFields map[string]string `json:"custom_fields" yaml:"custom_fields"`
	Code         string            `json:"code" yaml:"code"`
	CreateTask   bool              `json:"create_task" yaml:"create_task"`
	SyncTask     bool              `json:"sync_task" yaml:"sync_task"`
	AssignTo     string            `json:"assign_to" yaml:"assign_to"` //todo: change to assignee
}

type DeviceStatusResponse added in v1.1.3

type DeviceStatusResponse struct {
	Authorized bool `json:"authorized"`
	Exist      bool `json:"exist"`
}

type FileInfo

type FileInfo struct {
	Path     string `json:"path" yaml:"path"`
	Size     int64  `json:"size" yaml:"size"`
	Sha256   string `json:"sha256" yaml:"sha256"`
	FileName string `json:"file_name" yaml:"file_name"`
}

type Moment

type Moment struct {
	Name        string `json:"name" yaml:"name"`
	IsNew       bool   `json:"is_new" yaml:"is_new"`
	Title       string `json:"title" yaml:"title"`
	Description string `json:"description" yaml:"description"`
	// Timestamp seconds
	Timestamp float64 `json:"timestamp" yaml:"timestamp"`
	// Duration seconds
	Duration float64                `json:"duration" yaml:"duration"`
	Metadata map[string]string      `json:"metadata" yaml:"metadata"`
	Task     Task                   `json:"task" yaml:"task"`
	Event    map[string]interface{} `json:"event" yaml:"event"`
	Code     string                 `json:"code" yaml:"code"`
	RuleName string                 `json:"rule_name" yaml:"rule_name"`
}

type NetworkUsage

type NetworkUsage struct {
	TotalSent     atomic.Int64
	TotalReceived atomic.Int64
}

func (*NetworkUsage) AddReceived

func (nu *NetworkUsage) AddReceived(n int64)

func (*NetworkUsage) AddSent

func (nu *NetworkUsage) AddSent(n int64)

func (*NetworkUsage) GetTotalReceived

func (nu *NetworkUsage) GetTotalReceived() int64

func (*NetworkUsage) GetTotalSent

func (nu *NetworkUsage) GetTotalSent() int64

func (*NetworkUsage) ReduceReceived

func (nu *NetworkUsage) ReduceReceived(n int64) int64

func (*NetworkUsage) ReduceSent

func (nu *NetworkUsage) ReduceSent(n int64) int64

func (*NetworkUsage) Reset

func (nu *NetworkUsage) Reset()

type RecordCache

type RecordCache struct {
	Uploaded    bool   `json:"uploaded" yaml:"uploaded"`
	Skipped     bool   `json:"skipped" yaml:"skipped"`
	EventCode   string `json:"event_code" yaml:"event_code"`
	ProjectName string `json:"project_name" yaml:"project_name"`

	// Timestamp milliseconds
	Timestamp int64                  `json:"timestamp" yaml:"timestamp"`
	Labels    []string               `json:"labels" yaml:"labels"`
	Record    map[string]interface{} `json:"record" yaml:"record"`
	Moments   []Moment               `json:"moments" yaml:"moments"`

	UploadTask    map[string]interface{} `json:"task" yaml:"task"`
	DiagnosisTask map[string]interface{} `json:"diagnosis_task" yaml:"diagnosis_task"`

	// key is absolute file path, value is file info
	OriginalFiles     map[string]FileInfo `json:"files" yaml:"files"`
	UploadedFilePaths []string            `json:"uploaded_filepaths" yaml:"uploaded_filepaths"`

	// randomPostfix is used to avoid conflict when creating cache folder
	RandomPostfix string `json:"random_postfix" yaml:"random_postfix"`
	// contains filtered or unexported fields
}

func (*RecordCache) Clean

func (rc *RecordCache) Clean() string

func (*RecordCache) GetBaseFolder

func (rc *RecordCache) GetBaseFolder() string

func (*RecordCache) GetRecordCachePath

func (rc *RecordCache) GetRecordCachePath() string

func (*RecordCache) Reload

func (rc *RecordCache) Reload() (*RecordCache, error)

func (*RecordCache) Save

func (rc *RecordCache) Save() error

type Task

type Task struct {
	ShouldCreate bool   `json:"should_create" yaml:"should_create"`
	Name         string `json:"name" yaml:"name"`
	Title        string `json:"title" yaml:"title"`
	Description  string `json:"description" yaml:"description"`
	RecordName   string `json:"record_name" yaml:"record_name"`
	Assignee     string `json:"assignee" yaml:"assignee"`
	SyncTask     bool   `json:"sync_task" yaml:"sync_task"`
}

Jump to

Keyboard shortcuts

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