Documentation
¶
Index ¶
- Constants
- Variables
- func HandleRecords(ctx context.Context, logger *zap.Logger, records <-chan *model.WorkflowRecord, ...)
- type AlertAnalyzeResponse
- type AlertCheckConfig
- type AlertCheckResponse
- type ChunkCompletionResponse
- type CompletionResponse
- type CompletionResponseData
- type DifyClient
- type DifyRepo
- type DifyResponse
- type DifyUser
- type Handle
- type WorkflowRequest
- type WorkflowResponse
Constants ¶
View Source
const ( DIFY_WORKFLOWS_RUN = "/v1/workflows/run" DIFY_ADD_USER = "/console/api/workspaces/apo/members/add" DIFY_REMOVE_USER = "/console/api/workspaces/apo/members/" DIFY_PASSWD_UPDATE = "/console/api/apo/account/password" DIFY_RESET_PASSWD = "/console/api/apo/account/reset-password" )
View Source
const MAX_CACHE_SIZE = 100
Variables ¶
Functions ¶
func HandleRecords ¶
Types ¶
type AlertAnalyzeResponse ¶
type AlertAnalyzeResponse struct {
// contains filtered or unexported fields
}
func (*AlertAnalyzeResponse) WorkflowRunID ¶
func (r *AlertAnalyzeResponse) WorkflowRunID() string
type AlertCheckConfig ¶
type AlertCheckConfig struct { FlowId string FlowName string APIKey string Authorization string AnalyzeAuth string User string Sampling string CacheMinutes int MaxConcurrency int Prom prometheus.Repo }
func DefaultAlertCheckConfig ¶
func DefaultAlertCheckConfig() *AlertCheckConfig
type AlertCheckResponse ¶
type AlertCheckResponse struct {
// contains filtered or unexported fields
}
func (*AlertCheckResponse) CreatedAt ¶
func (r *AlertCheckResponse) CreatedAt() int64
UnixMicro Timestamp
func (*AlertCheckResponse) WorkflowRunID ¶
func (r *AlertCheckResponse) WorkflowRunID() string
type ChunkCompletionResponse ¶
type ChunkCompletionResponse struct{}
type CompletionResponse ¶
type CompletionResponse struct { WorkflowRunID string `json:"workflow_run_id"` TaskID string `json:"task_id"` Data CompletionResponseData `json:"data"` }
type CompletionResponseData ¶
type DifyClient ¶
func (*DifyClient) WorkflowsRun ¶
func (c *DifyClient) WorkflowsRun(req *WorkflowRequest, authorization string) (WorkflowResponse, error)
type DifyRepo ¶
type DifyRepo interface { AddUser(username string, password string, role string) (*DifyResponse, error) UpdatePassword(username string, oldPassword string, newPassword string) (*DifyResponse, error) RemoveUser(username string) (*DifyResponse, error) ResetPassword(username string, newPassword string) (*DifyResponse, error) PrepareAsyncAlertCheckWorkflow(cfg *AlertCheckConfig, logger *zap.Logger) (records <-chan *model.WorkflowRecord, err error) SubmitAlertEvents(events []alert.AlertEvent) GetCacheMinutes() int GetAlertCheckFlowID() string GetAlertAnalyzeFlowID() string WorkflowsRun(req *WorkflowRequest, authorization string) (*CompletionResponse, error) }
type DifyResponse ¶
type WorkflowRequest ¶
type WorkflowRequest struct { Inputs json.RawMessage `json:"inputs"` ResponseMode string `json:"response_mode"` User string `json:"user"` }
type WorkflowResponse ¶
type WorkflowResponse interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.