service

package
v0.0.0-...-36f034f Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchTask

type BatchTask interface {
	CreateTask(ctx context.Context, req *CreateTaskReq) (*CreateTaskResp, error)
	GetList(ctx context.Context, req *GetListReq) (*GetListResp, error)
	GetByID(ctx context.Context, req *GetByIDReq) (*GetByIDResp, error)
	Subscribe(ctx context.Context, req *SubscribeReq) (*SubscribeResp, error)
	GetProcessing(ctx context.Context, req *GetProcessingReq) (*GetProcessingResp, error)
	Delete(ctx context.Context, req *DeleteReq) (*DeleteResp, error)
	Timeout(ctx context.Context)
}

BatchTask BatchTask

func NewBatchTask

func NewBatchTask(conf *config.Config, factor chan *comet.FactorData) (BatchTask, error)

NewBatchTask NewBatchTask

type CreateTaskReq

type CreateTaskReq struct {
	ID       string  `json:"taskID"`
	UserID   string  `json:"userID"`
	UserName string  `json:"userName"`
	DepID    string  `json:"depID"`
	Value    logic.M `json:"value" binding:"required"`
	Addr     string  `json:"addr"`
	Opt      string  `json:"opt"`
	Size     int     `json:"size"`
	Command  string  `json:"command" binding:"required"`
	Title    string  `json:"title"`
}

CreateTaskReq CreateTaskReq

type CreateTaskResp

type CreateTaskResp struct {
	TaskID string `json:"taskID"`
}

CreateTaskResp CreateTaskResp

type DaprEvent

type DaprEvent struct {
	Topic           string         `json:"topic"`
	Pubsubname      string         `json:"pubsubname"`
	Traceid         string         `json:"traceid"`
	ID              string         `json:"id"`
	Datacontenttype string         `json:"datacontenttype"`
	Data            *CreateTaskReq `json:"data"`
	Type            string         `json:"type"`
	Specversion     string         `json:"specversion"`
	Source          string         `json:"source"`
}

DaprEvent DaprEvent

type DeleteReq

type DeleteReq struct {
	TaskID string `json:"taskID"`
}

DeleteReq DeleteReq

type DeleteResp

type DeleteResp struct {
}

DeleteResp DeleteResp

type GetByIDReq

type GetByIDReq struct {
	TaskID string `json:"-"`
}

GetByIDReq GetByIDReq

type GetByIDResp

type GetByIDResp struct {
	ID        string            `json:"id"`
	Title     string            `json:"title"`
	Status    models.TaskStatus `json:"status"`
	Result    logic.M           `json:"result"`
	Command   string            `json:"command"`
	Ratio     float64           `json:"ratio"`
	Value     logic.M           `json:"value"`
	CreatedAt int64             `json:"createdAt"`
	FinishAt  int64             `json:"finishAt"`
}

GetByIDResp GetByIDResp

type GetListReq

type GetListReq struct {
	UserID string            `json:"userID"`
	Status models.TaskStatus `json:"status"`
	Page   int               `json:"page"`
	Limit  int               `json:"limit"`
	Types  string            `json:"types"`
}

GetListReq GetListReq

type GetListResp

type GetListResp struct {
	List  []*TaskListVo `json:"list"`
	Total int64         `json:"total"`
}

GetListResp GetListResp

type GetProcessingReq

type GetProcessingReq struct {
	Types  string `json:"types"`
	UserID string `json:"user_id"`
}

GetProcessingReq GetProcessingReq

type GetProcessingResp

type GetProcessingResp struct {
	Total int64 `json:"total"`
}

GetProcessingResp GetProcessingResp

type SubscribeReq

type SubscribeReq struct {
	UserID string `json:"userID"`
	UUID   string `json:"uuid"`
	Topic  string `json:"topic" binding:"required"`
	Key    string `json:"key" binding:"required"`
}

SubscribeReq SubscribeReq

type SubscribeResp

type SubscribeResp struct {
	IsFinish bool              `json:"isFinish"`
	Status   models.TaskStatus `json:"status"`
}

SubscribeResp SubscribeResp

type TaskListVo

type TaskListVo struct {
	ID        string            `json:"id"`
	Title     string            `json:"title"`
	Status    models.TaskStatus `json:"status"`
	Result    logic.M           `json:"result"`
	Command   string            `json:"command"`
	Ratio     float64           `json:"ratio"`
	Value     logic.M           `json:"value"`
	CreatedAt int64             `json:"createdAt"`
	FinishAt  int64             `json:"finishAt"`
}

TaskListVo TaskListVo

Jump to

Keyboard shortcuts

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