domain

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package domain is a generated GoMock package.

Package domain is a generated GoMock package.

Package domain is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenTaskID

func GenTaskID() string

GenTaskID returns task-[0-9a-f](8), which keep the same as TESK

Types

type BioosInfo

type BioosInfo struct {
	AccountID    string
	UserID       string
	SubmissionID string
	RunID        string
	Meta         *BioosInfoMeta
}

BioosInfo ...

type BioosInfoMeta

type BioosInfoMeta struct {
	AAIPassport     *string
	MountTOS        *bool
	BucketsAuthInfo *BucketsAuthInfo
}

BioosInfoMeta ...

type BucketsAuthInfo

type BucketsAuthInfo struct {
	ReadOnly  []string
	ReadWrite []string
	External  []*ExternalBucketAuthInfo
}

BucketsAuthInfo ...

type Executor

type Executor struct {
	Image   string
	Command []string
	Workdir string
	Stdin   string
	Stdout  string
	Stderr  string
	Env     map[string]string
}

Executor ...

type ExecutorLog

type ExecutorLog struct {
	ExecutorID string
	StartTime  *time.Time
	EndTime    *time.Time
}

ExecutorLog ...

type ExternalBucketAuthInfo

type ExternalBucketAuthInfo struct {
	Bucket string
	AK     string
	SK     string
}

ExternalBucketAuthInfo ...

type FakeNormalizer

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

FakeNormalizer is a mock of Normalizer interface.

func NewFakeNormalizer

func NewFakeNormalizer(ctrl *gomock.Controller) *FakeNormalizer

NewFakeNormalizer creates a new mock instance.

func (*FakeNormalizer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*FakeNormalizer) Normalize

func (m *FakeNormalizer) Normalize(task *Task) error

Normalize mocks base method.

type FakeNormalizerMockRecorder

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

FakeNormalizerMockRecorder is the mock recorder for FakeNormalizer.

func (*FakeNormalizerMockRecorder) Normalize

func (mr *FakeNormalizerMockRecorder) Normalize(task interface{}) *gomock.Call

Normalize indicates an expected call of Normalize.

type FakeRepo

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

FakeRepo is a mock of Repo interface.

func NewFakeRepo

func NewFakeRepo(ctrl *gomock.Controller) *FakeRepo

NewFakeRepo creates a new mock instance.

func (*FakeRepo) CheckIDExist

func (m *FakeRepo) CheckIDExist(ctx context.Context, id string) (bool, error)

CheckIDExist mocks base method.

func (*FakeRepo) Create

func (m *FakeRepo) Create(ctx context.Context, task *Task) error

Create mocks base method.

func (*FakeRepo) EXPECT

func (m *FakeRepo) EXPECT() *FakeRepoMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*FakeRepo) GetStatus

func (m *FakeRepo) GetStatus(ctx context.Context, id string) (*TaskStatus, error)

GetStatus mocks base method.

func (*FakeRepo) UpdateStatus

func (m *FakeRepo) UpdateStatus(ctx context.Context, taskStatus *TaskStatus) (bool, error)

UpdateStatus mocks base method.

type FakeRepoMockRecorder

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

FakeRepoMockRecorder is the mock recorder for FakeRepo.

func (*FakeRepoMockRecorder) CheckIDExist

func (mr *FakeRepoMockRecorder) CheckIDExist(ctx, id interface{}) *gomock.Call

CheckIDExist indicates an expected call of CheckIDExist.

func (*FakeRepoMockRecorder) Create

func (mr *FakeRepoMockRecorder) Create(ctx, task interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*FakeRepoMockRecorder) GetStatus

func (mr *FakeRepoMockRecorder) GetStatus(ctx, id interface{}) *gomock.Call

GetStatus indicates an expected call of GetStatus.

func (*FakeRepoMockRecorder) UpdateStatus

func (mr *FakeRepoMockRecorder) UpdateStatus(ctx, taskStatus interface{}) *gomock.Call

UpdateStatus indicates an expected call of UpdateStatus.

type FakeService

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

FakeService is a mock of Service interface.

func NewFakeService

func NewFakeService(ctrl *gomock.Controller) *FakeService

NewFakeService creates a new mock instance.

func (*FakeService) Cancel

func (m *FakeService) Cancel(ctx context.Context, id string) error

Cancel mocks base method.

func (*FakeService) Create

func (m *FakeService) Create(ctx context.Context, task *Task) (string, error)

Create mocks base method.

func (*FakeService) EXPECT

func (m *FakeService) EXPECT() *FakeServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*FakeService) Update

func (m *FakeService) Update(ctx context.Context, id string, state, clusterID *string, logs []*TaskLog) error

Update mocks base method.

type FakeServiceMockRecorder

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

FakeServiceMockRecorder is the mock recorder for FakeService.

func (*FakeServiceMockRecorder) Cancel

func (mr *FakeServiceMockRecorder) Cancel(ctx, id interface{}) *gomock.Call

Cancel indicates an expected call of Cancel.

func (*FakeServiceMockRecorder) Create

func (mr *FakeServiceMockRecorder) Create(ctx, task interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*FakeServiceMockRecorder) Update

func (mr *FakeServiceMockRecorder) Update(ctx, id, state, clusterID, logs interface{}) *gomock.Call

Update indicates an expected call of Update.

type GPUResource

type GPUResource struct {
	Count float64
	Type  string
}

GPUResource ...

type Input

type Input struct {
	Name        string
	Description string
	Path        string
	Type        string
	URL         string
	Content     string
}

Input ...

type Normalizer

type Normalizer interface {
	Normalize(task *Task) error
}

Normalizer ...

type Output

type Output struct {
	Name        string
	Description string
	Path        string
	Type        string
	URL         string
}

Output ...

type Repo

type Repo interface {
	Create(ctx context.Context, task *Task) error
	GetStatus(ctx context.Context, id string) (*TaskStatus, error)
	UpdateStatus(ctx context.Context, taskStatus *TaskStatus) (bool, error)
	CheckIDExist(ctx context.Context, id string) (bool, error)
}

Repo ...

type Resources

type Resources struct {
	CPUCores   int
	RamGB      float64 // nolint
	DiskGB     float64
	BootDiskGB *int
	GPU        *GPUResource
}

Resources ...

type Service

type Service interface {
	Create(ctx context.Context, task *Task) (string, error)
	Cancel(ctx context.Context, id string) error
	Update(ctx context.Context, id string, state, clusterID *string, logs []*TaskLog) error
}

Service ...

func NewService

func NewService(repo Repo, normalizer Normalizer) Service

NewService ...

type Task

type Task struct {
	TaskStatus
	Name          string
	Description   string
	Inputs        []*Input
	Outputs       []*Output
	Resources     *Resources
	Executors     []*Executor
	Volumes       []string
	Tags          map[string]string
	BioosInfo     *BioosInfo
	PriorityValue int
}

Task ...

type TaskLog

type TaskLog struct {
	ClusterID  string
	Logs       [][]*ExecutorLog
	StartTime  *time.Time
	EndTime    *time.Time
	SystemLogs []string
}

TaskLog ...

type TaskStatus

type TaskStatus struct {
	ID           string
	State        string
	Logs         []*TaskLog
	CreationTime time.Time
	ClusterID    string

	StatusResourceVersion int
}

TaskStatus contains fields not specified by CreateTask

func (*TaskStatus) Cancel

func (t *TaskStatus) Cancel() error

Cancel ...

func (*TaskStatus) UpdateClusterID

func (t *TaskStatus) UpdateClusterID(clusterID string) error

UpdateClusterID ...

func (*TaskStatus) UpdateLogs

func (t *TaskStatus) UpdateLogs(newLogs []*TaskLog) error

UpdateLogs ...

func (*TaskStatus) UpdateState

func (t *TaskStatus) UpdateState(newState string) error

UpdateState ...

Jump to

Keyboard shortcuts

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