function

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsRequest

type AnalyticsRequest = FunctionAnalyticsRequest

type AnalyticsResponse

type AnalyticsResponse = FunctionAnalyticsResponse

type BatchCopyFunctionsRequest

type BatchCopyFunctionsRequest struct {
	Functions []FunctionCopyRequest `json:"functions"`
}

type BatchCopyFunctionsResponse

type BatchCopyFunctionsResponse struct {
	Results []FunctionCopyResponse `json:"results"`
}

type BatchDeleteFunctionsRequest

type BatchDeleteFunctionsRequest struct {
	FunctionIds []string `json:"functionIds"`
}

type BatchDeleteFunctionsResponse

type BatchDeleteFunctionsResponse struct {
	Deleted []string `json:"deleted"`
	Failed  []string `json:"failed"`
}

type BatchUpdateFunctionsRequest

type BatchUpdateFunctionsRequest struct {
	Updates []FunctionRouteUpdateRequest `json:"updates"`
}

type BatchUpdateFunctionsResponse

type BatchUpdateFunctionsResponse struct {
	Results []FunctionRouteResponse `json:"results"`
}

type CopyRequest

type CopyRequest = FunctionCopyRequest

type CopyResponse

type CopyResponse = FunctionCopyResponse

type DeleteRequest

type DeleteRequest = FunctionDeleteRequest

type Descriptor

type Descriptor struct {
	Id          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Input       map[string]interface{} `json:"input"`
	Output      map[string]interface{} `json:"output"`
}

type DescriptorsRequest

type DescriptorsRequest struct {
	GameId string `json:"gameId"`
	Env    string `json:"env"`
}

type DescriptorsResponse

type DescriptorsResponse struct {
	Items []Descriptor `json:"items"`
}

type DetailRequest

type DetailRequest = FunctionDetailRequest

type DetailResponse

type DetailResponse = FunctionDetailResponse

type DisableRequest

type DisableRequest = FunctionDisableRequest

type EnableRequest

type EnableRequest = FunctionEnableRequest

type Function

type Function struct {
	Id          string      `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Category    string      `json:"category"`
	GameId      string      `json:"gameId"`
	Status      int         `json:"status"`
	Version     string      `json:"version"`
	Instances   int         `json:"instances"`
	SpecFormat  string      `json:"specFormat"`
	OpenAPISpec interface{} `json:"openapiSpec"`
	CreatedAt   string      `json:"createdAt"`
	UpdatedAt   string      `json:"updatedAt"`
}

Function represents a function entity

type FunctionActionRequest

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

FunctionActionRequest represents an action request on a function

type FunctionAnalyticsRequest

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

FunctionAnalyticsRequest represents a request for function analytics

type FunctionAnalyticsResponse

type FunctionAnalyticsResponse struct {
	TotalCalls     int64   `json:"totalCalls"`
	SuccessRate    float64 `json:"successRate"`
	AvgLatency     float64 `json:"avgLatency"`
	CallsToday     int64   `json:"callsToday"`
	CallsThisWeek  int64   `json:"callsThisWeek"`
	CallsThisMonth int64   `json:"callsThisMonth"`
}

FunctionAnalyticsResponse represents analytics data for a function

type FunctionCopyRequest

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

FunctionCopyRequest represents a request to copy a function

type FunctionCopyResponse

type FunctionCopyResponse struct {
	FunctionId string `json:"function_id"`
	NewId      string `json:"new_id"`
}

FunctionCopyResponse represents the response of a function copy operation

type FunctionDeleteRequest

type FunctionDeleteRequest struct {
	FunctionId string `json:"functionId"`
}

FunctionDeleteRequest represents a request to delete a function

type FunctionDescriptor

type FunctionDescriptor struct {
	Input  interface{} `json:"input"`
	Output interface{} `json:"output"`
	Schema interface{} `json:"schema"`
}

FunctionDescriptor represents the input/output schema of a function

type FunctionDetailRequest

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

FunctionDetailRequest represents a request to get function details

type FunctionDetailResponse

type FunctionDetailResponse struct {
	Function
	Descriptor FunctionDescriptor `json:"descriptor"`
}

FunctionDetailResponse represents the detailed response of a function

type FunctionDisableRequest

type FunctionDisableRequest struct {
	FunctionId string `json:"functionId"`
}

FunctionDisableRequest represents a request to disable a function

type FunctionEnableRequest

type FunctionEnableRequest struct {
	FunctionId string `json:"functionId"`
}

FunctionEnableRequest represents a request to enable a function

type FunctionHistoryItem

type FunctionHistoryItem struct {
	ID        string      `json:"id"`
	Action    string      `json:"action"`
	Operator  string      `json:"operator"`
	Timestamp string      `json:"timestamp"`
	Details   interface{} `json:"details"`
}

FunctionHistoryItem represents an item in the function history

type FunctionHistoryRequest

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

FunctionHistoryRequest represents a request for function history

type FunctionHistoryResponse

type FunctionHistoryResponse struct {
	Items []FunctionHistoryItem `json:"items"`
}

FunctionHistoryResponse represents the response containing function history

type FunctionInstance

type FunctionInstance struct {
	AgentId   string `json:"agentId"`
	AgentName string `json:"agentName"`
	Status    string `json:"status"`
	UpdatedAt string `json:"updatedAt"`
}

FunctionInstance represents an instance of a function on an agent

type FunctionInstancesAllRequest

type FunctionInstancesAllRequest struct {
}

FunctionInstancesAllRequest represents a request to get all function instances

type FunctionInstancesAllResponse

type FunctionInstancesAllResponse struct {
	Instances []map[string]interface{} `json:"instances"`
}

FunctionInstancesAllResponse represents the response containing all function instances

type FunctionInstancesRequest

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

FunctionInstancesRequest represents a request for function instances

type FunctionInstancesResponse

type FunctionInstancesResponse struct {
	Items []FunctionInstance `json:"items"`
}

FunctionInstancesResponse represents the response containing function instances

type FunctionInvokeRequest

type FunctionInvokeRequest struct {
	ID              string      `uri:"id"`
	Params          interface{} `json:"params"`
	Payload         interface{} `json:"payload"`
	GameID          string      `json:"gameId"`
	Env             string      `json:"env"`
	Mode            string      `json:"mode"`
	Route           string      `json:"route"`
	TargetServiceID string      `json:"target_service_id"`
	HashKey         string      `json:"hash_key"`
}

FunctionInvokeRequest represents a request to invoke a function

type FunctionInvokeResponse

type FunctionInvokeResponse struct {
	JobId  string      `json:"jobId"`
	JobID  string      `json:"jobID,omitempty"`
	Result interface{} `json:"result,omitempty"`
}

FunctionInvokeResponse represents the response of a function invocation

type FunctionPermission

type FunctionPermission struct {
	Resource string   `json:"resource"`
	Actions  []string `json:"actions"`
	Roles    []string `json:"roles"`
}

FunctionPermission represents a permission for a function

type FunctionPermissionsRequest

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

FunctionPermissionsRequest represents a request for function permissions

type FunctionPermissionsResponse

type FunctionPermissionsResponse struct {
	Items []FunctionPermission `json:"items"`
}

FunctionPermissionsResponse represents the response containing function permissions

type FunctionPermissionsUpdateRequest

type FunctionPermissionsUpdateRequest struct {
	ID          string               `uri:"id"`
	Permissions []FunctionPermission `json:"permissions"`
}

FunctionPermissionsUpdateRequest represents a request to update function permissions

type FunctionPublishRequest

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

FunctionPublishRequest represents a request to publish a function

type FunctionPublishResponse

type FunctionPublishResponse struct {
	ApprovalId string `json:"approvalId,omitempty"` // 如果需要审批
	Published  bool   `json:"published"`
}

FunctionPublishResponse represents the response of a function publish operation

type FunctionRouteConfig

type FunctionRouteConfig struct {
	Nodes  []string `json:"nodes"`
	Path   string   `json:"path"`
	Order  int      `json:"order"`
	Hidden bool     `json:"hidden"`
}

FunctionRouteConfig represents the route configuration for a function

type FunctionRouteRequest

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

FunctionRouteRequest represents a request for function route configuration

type FunctionRouteResponse

type FunctionRouteResponse struct {
	Menu   FunctionRouteConfig `json:"menu"`
	Source string              `json:"source"`
}

FunctionRouteResponse represents the response containing function route configuration

type FunctionRouteUpdateRequest

type FunctionRouteUpdateRequest struct {
	ID     string   `uri:"id"`
	Nodes  []string `json:"nodes"`
	Path   string   `json:"path"`
	Order  int      `json:"order"`
	Hidden bool     `json:"hidden"`
}

FunctionRouteUpdateRequest represents a request to update function route configuration

type FunctionUIHistoryItem

type FunctionUIHistoryItem struct {
	Version    int         `json:"version"`
	Schema     interface{} `json:"schema"`
	Layout     interface{} `json:"layout"`
	Components interface{} `json:"components"`
	Message    string      `json:"message"`
	CreatedBy  string      `json:"createdBy"`
	CreatedAt  string      `json:"createdAt"`
}

FunctionUIHistoryItem represents an item in the function UI history

type FunctionUIHistoryRequest

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

FunctionUIHistoryRequest represents a request for function UI history

type FunctionUIHistoryResponse

type FunctionUIHistoryResponse struct {
	Items []FunctionUIHistoryItem `json:"items"`
}

FunctionUIHistoryResponse represents the response containing function UI history

type FunctionUIRequest

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

FunctionUIRequest represents a request for function UI configuration

type FunctionUIResponse

type FunctionUIResponse struct {
	Schema         interface{} `json:"schema"`
	Layout         interface{} `json:"layout"`
	Components     interface{} `json:"components"`
	Custom         bool        `json:"custom"`
	HasDefault     bool        `json:"hasDefault"`
	UISource       string      `json:"uiSource"`       // custom_metadata/config_file_override/openapi_x_ui/none
	UISourceDetail string      `json:"uiSourceDetail"` // human-readable source description
}

FunctionUIResponse represents the response containing function UI configuration

type FunctionUIRollbackRequest

type FunctionUIRollbackRequest struct {
	ID      string `uri:"id"`
	Version int    `json:"version"`
}

FunctionUIRollbackRequest represents a request to rollback function UI

type FunctionUIRollbackResponse

type FunctionUIRollbackResponse struct {
	AppliedVersion int                 `json:"appliedVersion"`
	Current        *FunctionUIResponse `json:"current"`
}

FunctionUIRollbackResponse represents the response of a function UI rollback

type FunctionUIUpdateRequest

type FunctionUIUpdateRequest struct {
	ID         string      `uri:"id"`
	Schema     interface{} `json:"schema"`
	Layout     interface{} `json:"layout"`
	Components interface{} `json:"components"`
}

FunctionUIUpdateRequest represents a request to update function UI

type FunctionWarningItem

type FunctionWarningItem struct {
	Key        string `json:"key"`
	AgentID    string `json:"agent_id"`
	FunctionID string `json:"function_id"`
	Version    string `json:"version"`
	Code       string `json:"code"`
	Message    string `json:"message"`
	Count      int    `json:"count"`
	FirstSeen  string `json:"first_seen"`
	LastSeen   string `json:"last_seen"`
}

FunctionWarningItem represents a warning for a function

type FunctionWarningsRequest

type FunctionWarningsRequest struct {
	FunctionID string `form:"function_id"`
	AgentID    string `form:"agent_id"`
	Code       string `form:"code"`
	Limit      int    `form:"limit,optional,default=100"`
}

FunctionWarningsRequest represents a request for function warnings

type FunctionWarningsResponse

type FunctionWarningsResponse struct {
	Items []FunctionWarningItem `json:"items"`
}

FunctionWarningsResponse represents the response containing function warnings

type FunctionsListRequest

type FunctionsListRequest struct {
	Page     int    `form:"page,optional,default=1"`
	PageSize int    `form:"pageSize,optional,default=20"`
	GameId   string `form:"gameId"`
	Category string `form:"category"`
	Status   int    `form:"status"`
}

FunctionsListRequest represents a request to list functions

type FunctionsListResponse

type FunctionsListResponse struct {
	Items []Function `json:"items"`
	Total int64      `json:"total"`
	Page  int        `json:"page"`
	Size  int        `json:"pageSize"`
}

FunctionsListResponse represents the response containing a list of functions

type FunctionsPendingRequest

type FunctionsPendingRequest struct {
}

FunctionsPendingRequest represents a request for pending functions

type FunctionsPendingResponse

type FunctionsPendingResponse struct {
	Items []PendingFunction `json:"items"`
}

FunctionsPendingResponse represents the response containing pending functions

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Analytics

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

func (*Handler) BatchCopy

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

func (*Handler) BatchCopyFunctions

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

func (*Handler) BatchDelete

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

func (*Handler) BatchDeleteFunctions

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

func (*Handler) BatchUpdate

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

func (*Handler) BatchUpdateFunctions

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

func (*Handler) Copy

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

func (*Handler) Delete

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

func (*Handler) Descriptors

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

func (*Handler) Detail

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

func (*Handler) Disable

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

func (*Handler) Enable

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

func (*Handler) FunctionAnalytics

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

func (*Handler) FunctionCopy

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

func (*Handler) FunctionDelete

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

func (*Handler) FunctionDetail

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

func (*Handler) FunctionDisable

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

func (*Handler) FunctionEnable

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

func (*Handler) FunctionHistory

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

func (*Handler) FunctionInstances

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

func (*Handler) FunctionInstancesAll

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

func (*Handler) FunctionInvoke

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

func (*Handler) FunctionPermissions

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

func (*Handler) FunctionPermissionsUpdate

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

func (*Handler) FunctionPublish

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

func (*Handler) FunctionRoute

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

func (*Handler) FunctionRouteUpdate

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

func (*Handler) FunctionUI

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

func (*Handler) FunctionUIHistory

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

func (*Handler) FunctionUIRollback

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

func (*Handler) FunctionUIUpdate

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

func (*Handler) FunctionWarnings

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

func (*Handler) FunctionsList

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

func (*Handler) FunctionsPending

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

func (*Handler) History

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

func (*Handler) Instances

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

func (*Handler) InstancesAll

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

func (*Handler) Invoke

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

func (*Handler) List

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

func (*Handler) Pending

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

func (*Handler) Permissions

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

func (*Handler) PermissionsUpdate

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

func (*Handler) Publish

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

func (*Handler) Route

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

func (*Handler) RouteUpdate

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

func (*Handler) UI

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

func (*Handler) UIHistory

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

func (*Handler) UIRollback

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

func (*Handler) UIUpdate

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

func (*Handler) Warnings

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

type HistoryRequest

type HistoryRequest = FunctionHistoryRequest

type HistoryResponse

type HistoryResponse = FunctionHistoryResponse

type InstancesAllRequest

type InstancesAllRequest = FunctionInstancesAllRequest

type InstancesAllResponse

type InstancesAllResponse = FunctionInstancesAllResponse

type InstancesRequest

type InstancesRequest = FunctionInstancesRequest

type InstancesResponse

type InstancesResponse = FunctionInstancesResponse

type InvokeRequest

type InvokeRequest = FunctionInvokeRequest

type InvokeResponse

type InvokeResponse = FunctionInvokeResponse

type ListRequest

type ListRequest = FunctionsListRequest

type ListResponse

type ListResponse = FunctionsListResponse

type PendingFunction

type PendingFunction struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	GameId      string `json:"gameId"`
	Env         string `json:"env"`
	CreatedAt   string `json:"createdAt"`
}

PendingFunction represents a function pending approval

type PendingRequest

type PendingRequest = FunctionsPendingRequest

type PendingResponse

type PendingResponse = FunctionsPendingResponse

type PermissionsRequest

type PermissionsRequest = FunctionPermissionsRequest

type PermissionsResponse

type PermissionsResponse = FunctionPermissionsResponse

type PermissionsUpdateRequest

type PermissionsUpdateRequest = FunctionPermissionsUpdateRequest

type PublishRequest

type PublishRequest = FunctionPublishRequest

type PublishResponse

type PublishResponse = FunctionPublishResponse

type RouteRequest

type RouteRequest = FunctionRouteRequest

type RouteResponse

type RouteResponse = FunctionRouteResponse

type RouteUpdateRequest

type RouteUpdateRequest = FunctionRouteUpdateRequest

type Service

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

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) BatchCopyFunctions

func (*Service) BatchDeleteFunctions

func (*Service) BatchUpdateFunctions

func (*Service) Descriptors

func (s *Service) Descriptors(ctx context.Context, req *DescriptorsRequest) (*DescriptorsResponse, error)

func (*Service) FunctionAnalytics

func (s *Service) FunctionAnalytics(ctx context.Context, req *FunctionAnalyticsRequest) (*FunctionAnalyticsResponse, error)

func (*Service) FunctionCopy

func (s *Service) FunctionCopy(ctx context.Context, req *FunctionCopyRequest) (*FunctionCopyResponse, error)

func (*Service) FunctionDelete

func (s *Service) FunctionDelete(ctx context.Context, req *FunctionDeleteRequest) error

func (*Service) FunctionDetail

func (s *Service) FunctionDetail(ctx context.Context, req *FunctionDetailRequest) (*FunctionDetailResponse, error)

func (*Service) FunctionDisable

func (s *Service) FunctionDisable(ctx context.Context, req *FunctionDisableRequest) error

func (*Service) FunctionEnable

func (s *Service) FunctionEnable(ctx context.Context, req *FunctionEnableRequest) error

func (*Service) FunctionHistory

func (s *Service) FunctionHistory(ctx context.Context, req *FunctionHistoryRequest) (*FunctionHistoryResponse, error)

func (*Service) FunctionInstances

func (s *Service) FunctionInstances(ctx context.Context, req *FunctionInstancesRequest) (*FunctionInstancesResponse, error)

func (*Service) FunctionInstancesAll

func (*Service) FunctionInvoke

func (s *Service) FunctionInvoke(ctx context.Context, req *FunctionInvokeRequest) (*FunctionInvokeResponse, error)

func (*Service) FunctionPermissions

func (*Service) FunctionPermissionsUpdate

func (s *Service) FunctionPermissionsUpdate(ctx context.Context, req *FunctionPermissionsUpdateRequest) error

func (*Service) FunctionPublish

func (s *Service) FunctionPublish(ctx context.Context, req *FunctionPublishRequest) (*FunctionPublishResponse, error)

func (*Service) FunctionRoute

func (s *Service) FunctionRoute(ctx context.Context, req *FunctionRouteRequest) (*FunctionRouteResponse, error)

func (*Service) FunctionRouteUpdate

func (s *Service) FunctionRouteUpdate(ctx context.Context, req *FunctionRouteUpdateRequest) (*FunctionRouteResponse, error)

func (*Service) FunctionUI

func (s *Service) FunctionUI(ctx context.Context, req *FunctionUIRequest) (*FunctionUIResponse, error)

func (*Service) FunctionUIHistory

func (s *Service) FunctionUIHistory(ctx context.Context, req *FunctionUIHistoryRequest) (*FunctionUIHistoryResponse, error)

func (*Service) FunctionUIRollback

func (s *Service) FunctionUIRollback(ctx context.Context, req *FunctionUIRollbackRequest) error

func (*Service) FunctionUIUpdate

func (s *Service) FunctionUIUpdate(ctx context.Context, req *FunctionUIUpdateRequest) error

func (*Service) FunctionWarnings

func (s *Service) FunctionWarnings(ctx context.Context, req *FunctionWarningsRequest) (*FunctionWarningsResponse, error)

func (*Service) FunctionsList

func (s *Service) FunctionsList(ctx context.Context, req *FunctionsListRequest) (*FunctionsListResponse, error)

func (*Service) FunctionsPending

func (s *Service) FunctionsPending(ctx context.Context, req *FunctionsPendingRequest) (*FunctionsPendingResponse, error)

type UIHistoryRequest

type UIHistoryRequest = FunctionUIHistoryRequest

type UIHistoryResponse

type UIHistoryResponse = FunctionUIHistoryResponse

type UIRequest

type UIRequest = FunctionUIRequest

type UIResponse

type UIResponse = FunctionUIResponse

type UIRollbackRequest

type UIRollbackRequest = FunctionUIRollbackRequest

type UIUpdateRequest

type UIUpdateRequest = FunctionUIUpdateRequest

type WarningsRequest

type WarningsRequest = FunctionWarningsRequest

type WarningsResponse

type WarningsResponse = FunctionWarningsResponse

Jump to

Keyboard shortcuts

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