task

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 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 CancelBodyRequest

type CancelBodyRequest struct {
	ID string `json:"id"`
}

type CancelRequest

type CancelRequest struct {
	ID string `uri:"id"`
}

type DetailRequest

type DetailRequest struct {
	ID string `uri:"id"`
}

type DetailResponse

type DetailResponse struct {
	ID         string      `json:"id"`
	FunctionID string      `json:"function_id,omitempty"`
	Status     string      `json:"status,omitempty"`
	Progress   int32       `json:"progress,omitempty"`
	Message    string      `json:"message,omitempty"`
	GameID     string      `json:"game_id,omitempty"`
	Env        string      `json:"env,omitempty"`
	AgentID    string      `json:"agent_id,omitempty"`
	Result     interface{} `json:"result,omitempty"`
	Error      string      `json:"error,omitempty"`
	StartedAt  string      `json:"started_at,omitempty"`
	FinishedAt string      `json:"finished_at,omitempty"`
	CreatedAt  string      `json:"created_at,omitempty"`
	UpdatedAt  string      `json:"updated_at,omitempty"`
}

type EventItem

type EventItem struct {
	Seq       int64       `json:"seq"`
	Type      string      `json:"type"`
	Progress  int32       `json:"progress"`
	Message   string      `json:"message"`
	Payload   interface{} `json:"payload"`
	CreatedAt string      `json:"created_at"`
}

type EventsRequest

type EventsRequest struct {
	ID       string `uri:"id"`
	AfterSeq int64  `form:"after_seq"`
}

type EventsResponse

type EventsResponse struct {
	Items   []EventItem `json:"items"`
	NextSeq int64       `json:"next_seq"`
	Done    bool        `json:"done"`
}

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Cancel

func (h *Handler) Cancel(c *gin.Context)

func (*Handler) CancelByBody

func (h *Handler) CancelByBody(c *gin.Context)

func (*Handler) Detail

func (h *Handler) Detail(c *gin.Context)

func (*Handler) Events

func (h *Handler) Events(c *gin.Context)

func (*Handler) List

func (h *Handler) List(c *gin.Context)

func (*Handler) Start

func (h *Handler) Start(c *gin.Context)

type Item

type Item struct {
	ID         string `json:"id"`
	FunctionID string `json:"function_id,omitempty"`
	Status     string `json:"status,omitempty"`
	Progress   int32  `json:"progress,omitempty"`
	Message    string `json:"message,omitempty"`
	GameID     string `json:"game_id,omitempty"`
	Env        string `json:"env,omitempty"`
	AgentID    string `json:"agent_id,omitempty"`
	StartedAt  string `json:"started_at,omitempty"`
	FinishedAt string `json:"finished_at,omitempty"`
	CreatedAt  string `json:"created_at,omitempty"`
	Error      string `json:"error,omitempty"`
}

type ListRequest

type ListRequest struct {
	Status     string `form:"status"`
	FunctionID string `form:"function_id"`
	GameID     string `form:"game_id"`
	Env        string `form:"env"`
	Page       int    `form:"page,optional,default=1"`
	Size       int    `form:"size,optional,default=20"`
}

type ListResponse

type ListResponse struct {
	Items []Item `json:"items"`
	Total int    `json:"total"`
}

type Service

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

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) Cancel

func (s *Service) Cancel(ctx context.Context, req *CancelRequest) error

func (*Service) Detail

func (s *Service) Detail(ctx context.Context, req *DetailRequest) (*DetailResponse, error)

func (*Service) Events

func (s *Service) Events(ctx context.Context, req *EventsRequest) (*EventsResponse, error)

func (*Service) List

func (s *Service) List(ctx context.Context, req *ListRequest) (*ListResponse, error)

func (*Service) Start

func (s *Service) Start(ctx context.Context, req *StartRequest) (*StartResponse, error)

type StartRequest

type StartRequest struct {
	FunctionID string      `json:"function_id"`
	Params     interface{} `json:"params"`
}

type StartResponse

type StartResponse struct {
	TaskID string `json:"task_id"`
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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