Documentation ¶
Index ¶
- Constants
- func AppUrl() string
- func Id() string
- func TypeOf(payload MsgPayload) string
- type Action
- type AgentData
- type ChartMsg
- type CollectData
- type Context
- type DataFilter
- type Document
- type EventPayload
- type FileDef
- type FormField
- type FormFieldType
- type FormFieldValueType
- type FormMsg
- type HtmlMsg
- type InfoMsg
- type InstructMsg
- type JobFilter
- type KV
- func (j KV) Any(key string) (any, bool)
- func (j KV) Float64(key string) (float64, bool)
- func (j KV) Float64Value() (float64, bool)
- func (j KV) Int64(key string) (int64, bool)
- func (j KV) Int64Value() (int64, bool)
- func (j KV) List(key string) ([]any, bool)
- func (j KV) Map(key string) (map[string]interface{}, bool)
- func (j KV) Merge(kvs ...KV) KV
- func (j *KV) Scan(value interface{}) error
- func (j KV) String(key string) (string, bool)
- func (j KV) StringValue() (string, bool)
- func (j KV) Uint64(key string) (uint64, bool)
- func (j KV) Uint64Value() (uint64, bool)
- func (j KV) Value() (driver.Value, error)
- type KVMsg
- type LinkMsg
- type MarkdownMsg
- type Message
- type Mount
- type MsgPayload
- type ObjHeader
- type Registry
- type TableMsg
- type Task
- type TaskLimits
- type TaskRetry
- type TaskState
- type TextMsg
- type UI
- type Uid
- type WorkflowMetadata
- type WorkflowTask
Constants ¶
View Source
const ( MessageSendEvent = "message:send" InstructPushEvent = "instruct:push" )
View Source
const ( MountTypeVolume string = "volume" MountTypeBind string = "bind" MountTypeTmpfs string = "tmpfs" )
View Source
const ApiVersion = 1
Variables ¶
This section is empty.
Functions ¶
func TypeOf ¶
func TypeOf(payload MsgPayload) string
Types ¶
type ChartMsg ¶
type CollectData ¶
type Context ¶
type Context struct { // Message ID denormalized Id string // chat platform Platform string // channel or group Topic string // Sender's UserId as string. AsUser Uid // form id FormId string // form Rule id FormRuleId string // agent CollectId string // agent AgentVersion int // page rule id PageRuleId string // workflow rule id WorkflowRuleId string // llm tool rule id ToolRuleId string // contains filtered or unexported fields }
func (*Context) Cancel ¶
func (c *Context) Cancel() context.CancelFunc
func (*Context) SetTimeout ¶
type DataFilter ¶
type EventPayload ¶
type FileDef ¶
type FileDef struct { ObjHeader `bson:",inline"` // Status of upload Status int // User who created the file User string // Type of the file. MimeType string // Size of the file in bytes. Size int64 // Internal file location, i.e. path on disk or an S3 blob address. Location string }
FileDef is a stored record of a file upload
type FormField ¶
type FormField struct { Type FormFieldType `json:"type"` Key string `json:"key"` Value interface{} `json:"value"` ValueType FormFieldValueType `json:"value_type"` Label string `json:"label"` Placeholder string `json:"placeholder"` Option []string `json:"option"` Rule string `json:"rule"` }
type FormFieldType ¶
type FormFieldType string
const ( FormFieldText FormFieldType = "text" FormFieldPassword FormFieldType = "password" FormFieldNumber FormFieldType = "number" FormFieldColor FormFieldType = "color" FormFieldFile FormFieldType = "file" FormFieldMonth FormFieldType = "month" FormFieldDate FormFieldType = "date" FormFieldTime FormFieldType = "time" FormFieldEmail FormFieldType = "email" FormFieldUrl FormFieldType = "url" FormFieldRadio FormFieldType = "radio" FormFieldCheckbox FormFieldType = "checkbox" FormFieldRange FormFieldType = "range" FormFieldSelect FormFieldType = "select" FormFieldTextarea FormFieldType = "textarea" FormFieldHidden FormFieldType = "hidden" )
type FormFieldValueType ¶
type FormFieldValueType string
const ( FormFieldValueString FormFieldValueType = "string" FormFieldValueBool FormFieldValueType = "bool" FormFieldValueInt64 FormFieldValueType = "int64" FormFieldValueFloat64 FormFieldValueType = "float64" FormFieldValueStringSlice FormFieldValueType = "string_slice" FormFieldValueInt64Slice FormFieldValueType = "int64_slice" FormFieldValueFloat64Slice FormFieldValueType = "float64_slice" )
type FormMsg ¶
type InfoMsg ¶
type InfoMsg struct { Title string `json:"title"` Model interface{} `json:"model,omitempty"` }
type InstructMsg ¶
type InstructMsg struct { No string Object model.InstructObject Bot string Flag string Content KV Priority model.InstructPriority State model.InstructState ExpireAt time.Time }
func (InstructMsg) Convert ¶
func (t InstructMsg) Convert() any
type KV ¶
type KV map[string]interface{}
func (KV) Float64Value ¶
func (KV) Int64Value ¶
func (KV) StringValue ¶
func (KV) Uint64Value ¶
type LinkMsg ¶
type MarkdownMsg ¶
func (MarkdownMsg) Convert ¶
func (m MarkdownMsg) Convert() any
type Message ¶
type Message struct { Platform string Topic string Payload EventPayload }
type MsgPayload ¶
type MsgPayload interface {
Convert() any
}
func ToPayload ¶
func ToPayload(typ string, src []byte) MsgPayload
type ObjHeader ¶
type ObjHeader struct { // using string to get around rethinkdb's problems with uint64; // `bson:"_id"` tag is for mongodb to use as primary key '_id'. Id string `bson:"_id"` //id Uid CreatedAt time.Time UpdatedAt time.Time }
ObjHeader is the header shared by all stored objects.
type Registry ¶
type TableMsg ¶
type Task ¶
type Task struct { ID string `json:"id,omitempty"` State TaskState `json:"state,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` StartedAt *time.Time `json:"startedAt,omitempty"` CompletedAt *time.Time `json:"completedAt,omitempty"` FailedAt *time.Time `json:"failedAt,omitempty"` CMD []string `json:"cmd,omitempty"` Entrypoint []string `json:"entrypoint,omitempty"` Run string `json:"run,omitempty"` Image string `json:"image,omitempty"` Registry *Registry `json:"registry,omitempty"` Env map[string]string `json:"env,omitempty"` Files map[string]string `json:"files,omitempty"` Error string `json:"error,omitempty"` Pre []*Task `json:"pre,omitempty"` Post []*Task `json:"post,omitempty"` Mounts []Mount `json:"mounts,omitempty"` Networks []string `json:"networks,omitempty"` Retry *TaskRetry `json:"retry,omitempty"` Limits *TaskLimits `json:"limits,omitempty"` Timeout string `json:"timeout,omitempty"` Result string `json:"result,omitempty"` GPUs string `json:"gpus,omitempty"` }
Task is the basic unit of work that a Worker can handle.
func CloneTasks ¶
type TaskLimits ¶
type TaskLimits struct { CPUs string `json:"cpus,omitempty"` Memory string `json:"memory,omitempty"` }
func (*TaskLimits) Clone ¶
func (l *TaskLimits) Clone() *TaskLimits
type TaskRetry ¶
type TaskState ¶
type TaskState string
TaskState State defines the list of states that a task can be in, at any given moment.
type Uid ¶
type Uid string
Uid is a database-specific record id, suitable to be used as a primary key.
const ZeroUid Uid = ""
ZeroUid is a constant representing uninitialized Uid.
type WorkflowMetadata ¶
type WorkflowMetadata struct { Name string `json:"name" yaml:"name"` Describe string `json:"describe" yaml:"describe"` Triggers []struct { Type string `json:"type" yaml:"type"` Rule KV `json:"rule,omitempty" yaml:"rule"` } `json:"triggers" yaml:"triggers"` Pipeline []string `json:"pipeline" yaml:"pipeline"` Tasks []WorkflowTask `json:"tasks" yaml:"tasks"` }
type WorkflowTask ¶
type WorkflowTask struct { ID string `json:"id" yaml:"id"` Action string `json:"action" yaml:"action"` Describe string `json:"describe,omitempty" yaml:"describe"` Params KV `json:"params,omitempty" yaml:"params"` Vars []string `json:"vars,omitempty" yaml:"vars"` Conn []string `json:"conn,omitempty" yaml:"conn"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.