entity

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceQuota

type ResourceQuota struct {
	TenantId string `json:"tenantId" bson:"tenantId"`

	Concurrency int64 `json:"concurrency" bson:"concurrency"` // Task concurrency quota
	CPU         int64 `json:"cpu" bson:"cpu"`                 // CPU quota in cores
	Custom      int64 `json:"custom" bson:"custom"`           // Custom resource quota
	GPU         int64 `json:"gpu" bson:"gpu"`                 // GPU quota in cores
	Memory      int64 `json:"memory" bson:"memory"`           // Memory quota in MB
	Storage     int64 `json:"storage" bson:"storage"`         // Storage quota in MB

	Peak float32 `json:"peak" bson:"peak"` // Actual or realtime resource usage can exceed quota in percent. Ranged from 0 to 1.0 (or higher)
}

ResourceQuota tenant resource quota options. Resource quotas are optional, 0 means there is no limit for specified resource type

func (*ResourceQuota) CPUEnabled

func (q *ResourceQuota) CPUEnabled() bool

func (*ResourceQuota) ConcurrencyEnabled

func (q *ResourceQuota) ConcurrencyEnabled() bool

func (*ResourceQuota) CustomEnabled

func (q *ResourceQuota) CustomEnabled() bool

func (*ResourceQuota) Fields

func (q *ResourceQuota) Fields() []interface{}

func (*ResourceQuota) GPUEnabled

func (q *ResourceQuota) GPUEnabled() bool

func (*ResourceQuota) MemoryEnabled

func (q *ResourceQuota) MemoryEnabled() bool

func (*ResourceQuota) PeakEnabled

func (q *ResourceQuota) PeakEnabled() bool

func (*ResourceQuota) StorageEnabled

func (q *ResourceQuota) StorageEnabled() bool

type Task added in v0.1.6

type Task struct {
	Uid              string          `json:"uid" bson:"uid"`
	TenantId         string          `json:"tenantId" bson:"tenantId"`
	Handler          string          `json:"handler" bson:"handler"`
	Config           string          `json:"config" bson:"config"`
	ScheduleStrategy string          `json:"scheduleStrategy" bson:"scheduleStrategy"`
	Priority         int32           `json:"priority" bson:"priority"`
	Progress         int32           `json:"progress" bson:"progress"`
	CreatedAt        time.Time       `json:"createdAt" bson:"createdAt"`
	UpdatedAt        time.Time       `json:"updatedAt" bson:"updatedAt"`
	Status           enum.TaskStatus `json:"status" bson:"status"`
}

Task defines the user task

func (*Task) Fields added in v0.1.6

func (t *Task) Fields() []interface{}

type TaskRun

type TaskRun struct {
	Id           string     `json:"id" bson:"_id"`
	TenantId     string     `json:"tenantId" bson:"tenantId"`
	TaskId       string     `json:"taskId" bson:"taskId"`
	TaskType     string     `json:"taskType" bson:"taskType"`
	ScheduleType string     `json:"scheduleType" bson:"scheduleType"`
	Status       string     `json:"status" bson:"status"`
	Result       *string    `json:"result" bson:"result"`
	Error        *string    `json:"error" bson:"error"`
	Start        *time.Time `json:"start" bson:"start"`
	End          *time.Time `json:"end" bson:"end"`
}

type TaskRunLog

type TaskRunLog struct {
	Id  int64
	Log string
}

type TaskRunLogs

type TaskRunLogs []*TaskRunLog

type TaskRuns

type TaskRuns []*TaskRun

TaskRuns is an array of TaskRun

type Tasks

type Tasks []*Task

Tasks is an array of Task

func (Tasks) TaskIds added in v0.1.6

func (ut Tasks) TaskIds() []string

TaskIds returns task ids

type Tenant

type Tenant struct {
	Uid        string    `json:"uid" bson:"uid"`
	Zone       string    `json:"zone" bson:"zone"`
	Partition  string    `json:"partition" bson:"partition"`
	Priority   int32     `json:"priority" bson:"priority"`
	Name       string    `json:"name" bson:"name"`
	Status     string    `json:"status" bson:"status"`
	CreatedAt  time.Time `json:"createdAt" bson:"createdAt"`
	UpdatedAt  time.Time `json:"updatedAt" bson:"updatedAt"`
	LastActive time.Time `json:"lastActive" bson:"lastActive"`

	ResourceQuota ResourceQuota `bson:"-" json:"resourceQuota"`
}

Tenant defines the tenant

func (*Tenant) Fields

func (t *Tenant) Fields() []interface{}

func (*Tenant) FieldsWithQuota

func (t *Tenant) FieldsWithQuota() []interface{}

type Tenants

type Tenants []*Tenant

Tenants is an array of Tenant

Jump to

Keyboard shortcuts

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