model

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameAgent = "agents"
View Source
const TableNameBehavior = "behavior"
View Source
const TableNameBot = "bots"
View Source
const TableNameChannel = "channels"
View Source
const TableNameConfig = "configs"
View Source
const TableNameCounter = "counters"
View Source
const TableNameCounterRecord = "counter_records"
View Source
const TableNameCycle = "cycles"
View Source
const TableNameDag = "dag"
View Source
const TableNameData = "data"
View Source
const TableNameFileupload = "fileuploads"
View Source
const TableNameForm = "form"
View Source
const TableNameInstruct = "instruct"
View Source
const TableNameJob = "jobs"
View Source
const TableNameKeyResult = "key_results"
View Source
const TableNameKeyResultValue = "key_result_values"
View Source
const TableNameMessage = "messages"
View Source
const TableNameOAuth = "oauth"
View Source
const TableNameObjective = "objectives"
View Source
const TableNamePage = "pages"
View Source
const TableNameParameter = "parameter"
View Source
const TableNamePlatform = "platforms"
View Source
const TableNamePlatformBot = "platform_bots"
View Source
const TableNamePlatformChannel = "platform_channels"
View Source
const TableNamePlatformChannelUser = "platform_channel_users"
View Source
const TableNamePlatformUser = "platform_users"
View Source
const TableNameReview = "reviews"
View Source
const TableNameReviewEvaluation = "review_evaluations"
View Source
const TableNameSchemaMigration = "schema_migrations"
View Source
const TableNameStep = "steps"
View Source
const TableNameTodo = "todos"
View Source
const TableNameTopic = "topics"
View Source
const TableNameUrl = "urls"
View Source
const TableNameUser = "users"
View Source
const TableNameWebhook = "webhook"
View Source
const TableNameWorkflow = "workflow"
View Source
const TableNameWorkflowScript = "workflow_script"
View Source
const TableNameWorkflowTrigger = "workflow_trigger"

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionState

type ActionState int
const (
	ActionStateUnknown ActionState = iota
	ActionStateLongTerm
	ActionStateSubmitSuccess
	ActionStateSubmitFailed
)

func (ActionState) Value

func (j ActionState) Value() (driver.Value, error)

type Agent added in v0.18.1

type Agent struct {
	ID             int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID            string    `gorm:"column:uid;not null" json:"uid"`
	Topic          string    `gorm:"column:topic;not null" json:"topic"`
	Hostid         string    `gorm:"column:hostid;not null" json:"hostid"`
	Hostname       string    `gorm:"column:hostname;not null" json:"hostname"`
	OnlineDuration int32     `gorm:"column:online_duration;not null" json:"online_duration"`
	LastOnlineAt   time.Time `gorm:"column:last_online_at;not null" json:"last_online_at"`
	CreatedAt      time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt      time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Agent mapped from table <agents>

func (*Agent) TableName added in v0.18.1

func (*Agent) TableName() string

TableName Agent's table name

type Behavior

type Behavior struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Flag      string    `gorm:"column:flag;not null" json:"flag"`
	Count_    int32     `gorm:"column:count;not null" json:"count"`
	Extra     *JSON     `gorm:"column:extra" json:"extra"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Behavior mapped from table <behavior>

func (*Behavior) TableName

func (*Behavior) TableName() string

TableName Behavior's table name

type Bot

type Bot struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	State     BotState  `gorm:"column:state;not null" json:"state"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Bot mapped from table <bots>

func (*Bot) TableName

func (*Bot) TableName() string

TableName Bot's table name

type BotState

type BotState int
const (
	BotStateUnknown BotState = iota
	BotActive
	BotInactive
)

func (BotState) Value

func (j BotState) Value() (driver.Value, error)

type Channel

type Channel struct {
	ID        int64        `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name      string       `gorm:"column:name;not null" json:"name"`
	Flag      string       `gorm:"column:flag;not null" json:"flag"`
	State     ChannelState `gorm:"column:state;not null" json:"state"`
	CreatedAt time.Time    `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time    `gorm:"column:updated_at;not null" json:"updated_at"`
}

Channel mapped from table <channels>

func (*Channel) TableName

func (*Channel) TableName() string

TableName Channel's table name

type ChannelState

type ChannelState int
const (
	ChannelStateUnknown ChannelState = iota
	ChannelActive
	ChannelInactive
)

func (ChannelState) Value

func (j ChannelState) Value() (driver.Value, error)

type Config

type Config struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Topic     string    `gorm:"column:topic;not null" json:"topic"`
	Key       string    `gorm:"column:key;not null" json:"key"`
	Value     JSON      `gorm:"column:value;not null" json:"value"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Config mapped from table <configs>

func (*Config) TableName

func (*Config) TableName() string

TableName Config's table name

type Counter

type Counter struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Topic     string    `gorm:"column:topic;not null" json:"topic"`
	Flag      string    `gorm:"column:flag;not null" json:"flag"`
	Digit     int64     `gorm:"column:digit;not null" json:"digit"`
	Status    int32     `gorm:"column:status;not null" json:"status"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Counter mapped from table <counters>

func (*Counter) TableName

func (*Counter) TableName() string

TableName Counter's table name

type CounterRecord

type CounterRecord struct {
	CounterID int64     `gorm:"column:counter_id;primaryKey" json:"counter_id"`
	Digit     int32     `gorm:"column:digit;not null" json:"digit"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
}

CounterRecord mapped from table <counter_records>

func (*CounterRecord) TableName

func (*CounterRecord) TableName() string

TableName CounterRecord's table name

type Cycle

type Cycle struct {
	ID         int64      `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID        string     `gorm:"column:uid;not null" json:"uid"`
	Topic      string     `gorm:"column:topic;not null" json:"topic"`
	Objectives string     `gorm:"column:objectives;not null" json:"objectives"`
	StartDate  time.Time  `gorm:"column:start_date;not null" json:"start_date"`
	EndDate    time.Time  `gorm:"column:end_date;not null" json:"end_date"`
	State      CycleState `gorm:"column:state;not null" json:"state"`
	CreatedAt  time.Time  `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt  time.Time  `gorm:"column:updated_at;not null" json:"updated_at"`
}

Cycle mapped from table <cycles>

func (*Cycle) TableName

func (*Cycle) TableName() string

TableName Cycle's table name

type CycleState

type CycleState int
const (
	CycleStateUnknown CycleState = iota
	CycleStart
	CycleDone
	CycleCancel
)

func (CycleState) Value

func (j CycleState) Value() (driver.Value, error)

type Dag

type Dag struct {
	ID            int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	WorkflowID    int64     `gorm:"column:workflow_id;not null" json:"workflow_id"`
	ScriptID      int64     `gorm:"column:script_id;not null" json:"script_id"`
	ScriptVersion int32     `gorm:"column:script_version;not null" json:"script_version"`
	Nodes         []*Node   `gorm:"column:nodes;type:json;not null;serializer:json" json:"nodes"`
	Edges         []*Edge   `gorm:"column:edges;type:json;not null;serializer:json" json:"edges"`
	CreatedAt     time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt     time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Dag mapped from table <dag>

func (*Dag) TableName

func (*Dag) TableName() string

TableName Dag's table name

type Data

type Data struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Topic     string    `gorm:"column:topic;not null" json:"topic"`
	Key       string    `gorm:"column:key;not null" json:"key"`
	Value     JSON      `gorm:"column:value;not null" json:"value"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Data mapped from table <data>

func (*Data) TableName

func (*Data) TableName() string

TableName Data's table name

type Edge

type Edge struct {
	Id                string `json:"id"`
	Source            string `json:"source"`
	Target            string `json:"target"`
	SourcePortId      string `json:"sourcePortId,omitempty"`
	TargetPortId      string `json:"targetPortId,omitempty"`
	Label             string `json:"label,omitempty"`
	EdgeContentWidth  int    `json:"edgeContentWidth,omitempty"`
	EdgeContentHeight int    `json:"edgeContentHeight,omitempty"`
	Connector         struct {
		Name string `json:"name,omitempty"`
	} `json:"connector,omitempty"`
	Router struct {
		Name string `json:"name,omitempty"`
	} `json:"router,omitempty"`
	SourcePort string `json:"sourcePort,omitempty"`
	TargetPort string `json:"targetPort,omitempty"`
}

type FileState

type FileState int
const (
	FileStateUnknown FileState = iota
	FileStart
	FileFinish
)

func (FileState) Value

func (j FileState) Value() (driver.Value, error)

type Fileupload

type Fileupload struct {
	ID        int64     `gorm:"column:id;primaryKey" json:"id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Mimetype  string    `gorm:"column:mimetype;not null" json:"mimetype"`
	Size      int64     `gorm:"column:size;not null" json:"size"`
	Location  string    `gorm:"column:location;not null" json:"location"`
	State     FileState `gorm:"column:state;not null" json:"state"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Fileupload mapped from table <fileuploads>

func (*Fileupload) TableName

func (*Fileupload) TableName() string

TableName Fileupload's table name

type Form

type Form struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	FormID    string    `gorm:"column:form_id;not null" json:"form_id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Topic     string    `gorm:"column:topic;not null" json:"topic"`
	Schema    JSON      `gorm:"column:schema;not null" json:"schema"`
	Values    JSON      `gorm:"column:values" json:"values"`
	Extra     JSON      `gorm:"column:extra" json:"extra"`
	State     FormState `gorm:"column:state;not null" json:"state"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Form mapped from table <form>

func (*Form) TableName

func (*Form) TableName() string

TableName Form's table name

type FormState

type FormState int
const (
	FormStateUnknown FormState = iota
	FormStateCreated
	FormStateSubmitSuccess
	FormStateSubmitFailed
)

func (FormState) Value

func (j FormState) Value() (driver.Value, error)

type IDList

type IDList []int64

func (IDList) GormDataType

func (j IDList) GormDataType() string

func (*IDList) Scan

func (j *IDList) Scan(value interface{}) error

func (IDList) Value

func (j IDList) Value() (driver.Value, error)

type Instruct

type Instruct struct {
	ID        int64            `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	No        string           `gorm:"column:no;not null" json:"no"`
	UID       string           `gorm:"column:uid;not null" json:"uid"`
	Object    InstructObject   `gorm:"column:object;not null" json:"object"`
	Bot       string           `gorm:"column:bot;not null" json:"bot"`
	Flag      string           `gorm:"column:flag;not null" json:"flag"`
	Content   JSON             `gorm:"column:content;not null" json:"content"`
	Priority  InstructPriority `gorm:"column:priority;not null" json:"priority"`
	State     InstructState    `gorm:"column:state;not null" json:"state"`
	ExpireAt  time.Time        `gorm:"column:expire_at;not null" json:"expire_at"`
	CreatedAt time.Time        `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time        `gorm:"column:updated_at;not null" json:"updated_at"`
}

Instruct mapped from table <instruct>

func (*Instruct) TableName

func (*Instruct) TableName() string

TableName Instruct's table name

type InstructObject

type InstructObject string
const (
	InstructObjectAgent InstructObject = "agent"
)

func (InstructObject) Value

func (j InstructObject) Value() (driver.Value, error)

type InstructPriority

type InstructPriority int
const (
	InstructPriorityHigh    InstructPriority = 3
	InstructPriorityDefault InstructPriority = 2
	InstructPriorityLow     InstructPriority = 1
)

func (InstructPriority) Value

func (j InstructPriority) Value() (driver.Value, error)

type InstructState

type InstructState int
const (
	InstructStateUnknown InstructState = iota
	InstructCreate
	InstructDone
	InstructCancel
)

func (InstructState) Value

func (j InstructState) Value() (driver.Value, error)

type JSON

type JSON map[string]interface{}

func (JSON) GormDataType

func (j JSON) GormDataType() string

func (*JSON) Scan

func (j *JSON) Scan(value interface{}) error

func (JSON) Value

func (j JSON) Value() (driver.Value, error)

type Job

type Job struct {
	ID            int64      `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID           string     `gorm:"column:uid;not null" json:"uid"`
	Topic         string     `gorm:"column:topic;not null" json:"topic"`
	WorkflowID    int64      `gorm:"column:workflow_id;not null" json:"workflow_id"`
	DagID         int64      `gorm:"column:dag_id;not null" json:"dag_id"`
	TriggerID     int64      `gorm:"column:trigger_id;not null" json:"trigger_id"`
	ScriptVersion int32      `gorm:"column:script_version;not null" json:"script_version"`
	State         JobState   `gorm:"column:state;not null" json:"state"`
	StartedAt     *time.Time `gorm:"column:started_at" json:"started_at"`
	EndedAt       *time.Time `gorm:"column:ended_at" json:"ended_at"`
	CreatedAt     time.Time  `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt     time.Time  `gorm:"column:updated_at;not null" json:"updated_at"`
	Steps         []*Step    `gorm:"foreignKey:job_id" json:"steps"`
}

Job mapped from table <jobs>

func (*Job) MarshalBinary

func (j *Job) MarshalBinary() (data []byte, err error)

func (*Job) TableName

func (*Job) TableName() string

TableName Job's table name

type JobState

type JobState int
const (
	JobStateUnknown JobState = iota
	JobReady
	JobStart
	JobRunning
	JobSucceeded
	JobCanceled
	JobFailed
)

func (JobState) Value

func (j JobState) Value() (driver.Value, error)

type KeyResult

type KeyResult struct {
	ID              int64             `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID             string            `gorm:"column:uid;not null" json:"uid"`
	Topic           string            `gorm:"column:topic;not null" json:"topic"`
	ObjectiveID     int64             `gorm:"column:objective_id;not null" json:"objective_id"`
	Sequence        int32             `gorm:"column:sequence;not null" json:"sequence"`
	Title           string            `gorm:"column:title;not null" json:"title"`
	Memo            string            `gorm:"column:memo;not null" json:"memo"`
	InitialValue    int32             `gorm:"column:initial_value;not null" json:"initial_value"`
	TargetValue     int32             `gorm:"column:target_value;not null" json:"target_value"`
	CurrentValue    int32             `gorm:"column:current_value;not null" json:"current_value"`
	ValueMode       ValueModeType     `gorm:"column:value_mode;not null" json:"value_mode"`
	Tag             string            `gorm:"column:tag;not null" json:"tag"`
	CreatedAt       time.Time         `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt       time.Time         `gorm:"column:updated_at;not null" json:"updated_at"`
	KeyResultValues []*KeyResultValue `gorm:"foreignKey:key_result_id" json:"key_result_values"`
	Todos           []*Todo           `gorm:"foreignKey:key_result_id" json:"todos"`
}

KeyResult mapped from table <key_results>

func (*KeyResult) TableName

func (*KeyResult) TableName() string

TableName KeyResult's table name

type KeyResultValue

type KeyResultValue struct {
	ID          int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	KeyResultID int64     `gorm:"column:key_result_id" json:"key_result_id"`
	Value       int32     `gorm:"column:value;not null" json:"value"`
	Memo        string    `gorm:"column:memo;not null" json:"memo"`
	CreatedAt   time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

KeyResultValue mapped from table <key_result_values>

func (*KeyResultValue) TableName

func (*KeyResultValue) TableName() string

TableName KeyResultValue's table name

type Message

type Message struct {
	ID            int64          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Flag          string         `gorm:"column:flag;not null" json:"flag"`
	PlatformID    int64          `gorm:"column:platform_id;not null" json:"platform_id"`
	PlatformMsgID string         `gorm:"column:platform_msg_id;not null" json:"platform_msg_id"`
	Topic         string         `gorm:"column:topic;not null" json:"topic"`
	Content       JSON           `gorm:"column:content" json:"content"`
	State         MessageState   `gorm:"column:state;not null" json:"state"`
	CreatedAt     time.Time      `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt     time.Time      `gorm:"column:updated_at;not null" json:"updated_at"`
	DeletedAt     gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

Message mapped from table <messages>

func (*Message) TableName

func (*Message) TableName() string

TableName Message's table name

type MessageState

type MessageState int
const (
	MessageStateUnknown MessageState = iota
	MessageCreated
)

func (MessageState) Value

func (j MessageState) Value() (driver.Value, error)

type Node

type Node struct {
	Id        string `json:"id"`
	Describe  string `json:"describe"`
	X         int    `json:"x,omitempty"`
	Y         int    `json:"y,omitempty"`
	Width     int    `json:"width,omitempty"`
	Height    int    `json:"height,omitempty"`
	Label     string `json:"label,omitempty"`
	RenderKey string `json:"renderKey,omitempty"`
	IsGroup   bool   `json:"isGroup,omitempty"`
	Group     string `json:"group,omitempty"`
	ParentId  string `json:"parentId,omitempty"`
	Ports     []struct {
		Id        string `json:"id,omitempty"`
		Group     string `json:"group,omitempty"`
		Type      string `json:"type,omitempty"`
		Tooltip   string `json:"tooltip,omitempty"`
		Connected bool   `json:"connected,omitempty"`
	} `json:"ports,omitempty"`
	Order       int                    `json:"_order,omitempty"`
	Bot         string                 `json:"bot"`
	RuleId      string                 `json:"rule_id"`
	Parameters  map[string]interface{} `json:"parameters,omitempty"`
	Variables   []string               `json:"variables,omitempty"`
	Connections []string               `json:"connections,omitempty"`
	Status      NodeStatus             `json:"status,omitempty"`
}

type NodeStatus

type NodeStatus string
const (
	NodeDefault    NodeStatus = "default"
	NodeSuccess    NodeStatus = "success"
	NodeProcessing NodeStatus = "processing"
	NodeError      NodeStatus = "error"
	NodeWarning    NodeStatus = "warning"
)

func (NodeStatus) Value

func (j NodeStatus) Value() (driver.Value, error)

type OAuth

type OAuth struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Topic     string    `gorm:"column:topic;not null" json:"topic"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Type      string    `gorm:"column:type;not null" json:"type"`
	Token     string    `gorm:"column:token;not null" json:"token"`
	Extra     JSON      `gorm:"column:extra;not null" json:"extra"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

OAuth mapped from table <oauth>

func (*OAuth) TableName

func (*OAuth) TableName() string

TableName OAuth's table name

type Objective

type Objective struct {
	ID           int64        `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID          string       `gorm:"column:uid;not null" json:"uid"`
	Topic        string       `gorm:"column:topic;not null" json:"topic"`
	Sequence     int32        `gorm:"column:sequence;not null" json:"sequence"`
	Progress     int32        `gorm:"column:progress;not null" json:"progress"`
	Title        string       `gorm:"column:title;not null" json:"title"`
	Memo         string       `gorm:"column:memo;not null" json:"memo"`
	Motive       string       `gorm:"column:motive;not null" json:"motive"`
	Feasibility  string       `gorm:"column:feasibility;not null" json:"feasibility"`
	IsPlan       int32        `gorm:"column:is_plan;not null" json:"is_plan"`
	PlanStart    time.Time    `gorm:"column:plan_start;not null" json:"plan_start"`
	PlanEnd      time.Time    `gorm:"column:plan_end;not null" json:"plan_end"`
	TotalValue   int32        `gorm:"column:total_value;not null" json:"total_value"`
	CurrentValue int32        `gorm:"column:current_value;not null" json:"current_value"`
	Tag          string       `gorm:"column:tag;not null" json:"tag"`
	CreatedData  time.Time    `gorm:"column:created_data;not null" json:"created_data"`
	UpdatedDate  time.Time    `gorm:"column:updated_date;not null" json:"updated_date"`
	KeyResults   []*KeyResult `gorm:"foreignKey:objective_id" json:"key_results"`
	Reviews      []*Review    `gorm:"foreignKey:objective_id" json:"reviews"`
}

Objective mapped from table <objectives>

func (*Objective) TableName

func (*Objective) TableName() string

TableName Objective's table name

type Page

type Page struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	PageID    string    `gorm:"column:page_id;not null" json:"page_id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Topic     string    `gorm:"column:topic;not null" json:"topic"`
	Type      PageType  `gorm:"column:type;not null" json:"type"`
	Schema    JSON      `gorm:"column:schema;not null" json:"schema"`
	State     PageState `gorm:"column:state;not null" json:"state"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Page mapped from table <pages>

func (*Page) TableName

func (*Page) TableName() string

TableName Page's table name

type PageState

type PageState int
const (
	PageStateUnknown PageState = iota
	PageStateCreated
	PageStateProcessedSuccess
	PageStateProcessedFailed
)

func (PageState) Value

func (j PageState) Value() (driver.Value, error)

type PageType

type PageType string
const (
	PageForm     PageType = "form"
	PageChart    PageType = "chart"
	PageTable    PageType = "table"
	PageJson     PageType = "json"
	PageHtml     PageType = "html"
	PageMarkdown PageType = "markdown"
)

func (PageType) Value

func (j PageType) Value() (driver.Value, error)

type Parameter

type Parameter struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Flag      string    `gorm:"column:flag;not null" json:"flag"`
	Params    JSON      `gorm:"column:params" json:"params"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
	ExpiredAt time.Time `gorm:"column:expired_at;not null" json:"expired_at"`
}

Parameter mapped from table <parameter>

func (*Parameter) IsExpired

func (p *Parameter) IsExpired() bool

IsExpired check expired

func (*Parameter) TableName

func (*Parameter) TableName() string

TableName Parameter's table name

type PipelineState

type PipelineState int
const (
	PipelineStateUnknown PipelineState = iota
	PipelineStart
	PipelineDone
	PipelineCancel
)

func (PipelineState) Value

func (j PipelineState) Value() (driver.Value, error)

type Platform

type Platform struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Platform mapped from table <platforms>

func (*Platform) TableName

func (*Platform) TableName() string

TableName Platform's table name

type PlatformBot

type PlatformBot struct {
	ID         int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	PlatformID int64     `gorm:"column:platform_id;not null" json:"platform_id"`
	BotID      int64     `gorm:"column:bot_id;not null" json:"bot_id"`
	Flag       string    `gorm:"column:flag;not null;default:0" json:"flag"`
	CreatedAt  time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt  time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

PlatformBot mapped from table <platform_bots>

func (*PlatformBot) TableName

func (*PlatformBot) TableName() string

TableName PlatformBot's table name

type PlatformChannel

type PlatformChannel struct {
	ID         int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	PlatformID int64     `gorm:"column:platform_id;not null" json:"platform_id"`
	ChannelID  int64     `gorm:"column:channel_id;not null" json:"channel_id"`
	Flag       string    `gorm:"column:flag;not null;default:0" json:"flag"`
	CreatedAt  time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt  time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

PlatformChannel mapped from table <platform_channels>

func (*PlatformChannel) TableName

func (*PlatformChannel) TableName() string

TableName PlatformChannel's table name

type PlatformChannelUser

type PlatformChannelUser struct {
	ID          int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	PlatformID  int64     `gorm:"column:platform_id;not null" json:"platform_id"`
	ChannelFlag string    `gorm:"column:channel_flag;not null" json:"channel_flag"`
	UserFlag    string    `gorm:"column:user_flag;not null" json:"user_flag"`
	CreatedAt   time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

PlatformChannelUser mapped from table <platform_channel_users>

func (*PlatformChannelUser) TableName

func (*PlatformChannelUser) TableName() string

TableName PlatformChannelUser's table name

type PlatformUser

type PlatformUser struct {
	ID         int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	PlatformID int64     `gorm:"column:platform_id;not null" json:"platform_id"`
	UserID     int64     `gorm:"column:user_id;not null" json:"user_id"`
	Flag       string    `gorm:"column:flag;not null" json:"flag"`
	Name       string    `gorm:"column:name;not null" json:"name"`
	Email      string    `gorm:"column:email;not null" json:"email"`
	AvatarURL  string    `gorm:"column:avatar_url;not null" json:"avatar_url"`
	IsBot      bool      `gorm:"column:is_bot;not null" json:"is_bot"`
	CreatedAt  time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt  time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

PlatformUser mapped from table <platform_users>

func (*PlatformUser) TableName

func (*PlatformUser) TableName() string

TableName PlatformUser's table name

type Review

type Review struct {
	ID          int64               `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID         string              `gorm:"column:uid;not null" json:"uid"`
	Topic       string              `gorm:"column:topic;not null" json:"topic"`
	ObjectiveID int64               `gorm:"column:objective_id;not null" json:"objective_id"`
	Type        ReviewType          `gorm:"column:type;not null" json:"type"`
	Rating      int32               `gorm:"column:rating;not null" json:"rating"`
	CreatedAt   time.Time           `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt   time.Time           `gorm:"column:updated_at;not null" json:"updated_at"`
	Evaluations []*ReviewEvaluation `gorm:"foreignKey:review_id" json:"evaluations"`
}

Review mapped from table <reviews>

func (*Review) TableName

func (*Review) TableName() string

TableName Review's table name

type ReviewEvaluation

type ReviewEvaluation struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID       string    `gorm:"column:uid;not null" json:"uid"`
	Topic     string    `gorm:"column:topic;not null" json:"topic"`
	ReviewID  int64     `gorm:"column:review_id;not null" json:"review_id"`
	Question  string    `gorm:"column:question;not null" json:"question"`
	Reason    string    `gorm:"column:reason;not null" json:"reason"`
	Solving   string    `gorm:"column:solving;not null" json:"solving"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

ReviewEvaluation mapped from table <review_evaluations>

func (*ReviewEvaluation) TableName

func (*ReviewEvaluation) TableName() string

TableName ReviewEvaluation's table name

type ReviewType

type ReviewType int
const (
	ReviewTypeUnknown ReviewType = iota
	ReviewMid
	ReviewEnd
)

func (ReviewType) Value

func (j ReviewType) Value() (driver.Value, error)

type SchemaMigration

type SchemaMigration struct {
	Version int64 `gorm:"column:version;primaryKey" json:"version"`
	Dirty   bool  `gorm:"column:dirty;not null" json:"dirty"`
}

SchemaMigration mapped from table <schema_migrations>

func (*SchemaMigration) TableName

func (*SchemaMigration) TableName() string

TableName SchemaMigration's table name

type SessionState

type SessionState int
const (
	SessionStateUnknown SessionState = iota
	SessionStart
	SessionDone
	SessionCancel
)

func (SessionState) Value

func (j SessionState) Value() (driver.Value, error)

type Step

type Step struct {
	ID        int64      `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID       string     `gorm:"column:uid;not null" json:"uid"`
	Topic     string     `gorm:"column:topic;not null" json:"topic"`
	JobID     int64      `gorm:"column:job_id;not null" json:"job_id"`
	Action    JSON       `gorm:"column:action;not null" json:"action"`
	Name      string     `gorm:"column:name;not null" json:"name"`
	Describe  string     `gorm:"column:describe;not null" json:"describe"`
	NodeID    string     `gorm:"column:node_id;not null" json:"node_id"`
	Depend    []string   `gorm:"column:depend;type:json;not null;serializer:json" json:"depend"`
	Input     JSON       `gorm:"column:input" json:"input"`
	Output    JSON       `gorm:"column:output" json:"output"`
	Error     string     `gorm:"column:error" json:"error"`
	State     StepState  `gorm:"column:state;not null" json:"state"`
	StartedAt *time.Time `gorm:"column:started_at" json:"started_at"`
	EndedAt   *time.Time `gorm:"column:ended_at" json:"ended_at"`
	CreatedAt time.Time  `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time  `gorm:"column:updated_at;not null" json:"updated_at"`
}

Step mapped from table <steps>

func (*Step) TableName

func (*Step) TableName() string

TableName Step's table name

type StepState

type StepState int
const (
	StepStateUnknown StepState = iota
	StepCreated
	StepReady
	StepStart
	StepRunning
	StepSucceeded
	StepFailed
	StepCanceled
	StepSkipped
)

func (StepState) Value

func (j StepState) Value() (driver.Value, error)

type Todo

type Todo struct {
	ID             int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID            string    `gorm:"column:uid;not null" json:"uid"`
	Topic          string    `gorm:"column:topic;not null" json:"topic"`
	KeyResultID    int64     `gorm:"column:key_result_id;not null" json:"key_result_id"`
	ParentID       int64     `gorm:"column:parent_id;not null" json:"parent_id"`
	Sequence       int32     `gorm:"column:sequence;not null" json:"sequence"`
	Content        string    `gorm:"column:content;not null" json:"content"`
	Category       string    `gorm:"column:category;not null" json:"category"`
	Remark         string    `gorm:"column:remark;not null" json:"remark"`
	Priority       int32     `gorm:"column:priority;not null" json:"priority"`
	IsRemindAtTime int32     `gorm:"column:is_remind_at_time;not null" json:"is_remind_at_time"`
	RemindAt       int64     `gorm:"column:remind_at;not null" json:"remind_at"`
	RepeatMethod   string    `gorm:"column:repeat_method;not null" json:"repeat_method"`
	RepeatRule     string    `gorm:"column:repeat_rule;not null" json:"repeat_rule"`
	RepeatEndAt    int64     `gorm:"column:repeat_end_at;not null" json:"repeat_end_at"`
	Complete       int32     `gorm:"column:complete;not null" json:"complete"`
	CreatedAt      time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt      time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
	SubTodos       []*Todo   `gorm:"foreignKey:parent_id" json:"sub_todos"`
}

Todo mapped from table <todos>

func (*Todo) TableName

func (*Todo) TableName() string

TableName Todo's table name

type Topic

type Topic struct {
	ID        int64      `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Flag      string     `gorm:"column:flag;not null" json:"flag"`
	Platform  string     `gorm:"column:platform;not null" json:"platform"`
	Owner     int64      `gorm:"column:owner;not null" json:"owner"`
	Name      string     `gorm:"column:name;not null" json:"name"`
	Type      string     `gorm:"column:type;not null" json:"type"`
	Tags      string     `gorm:"column:tags" json:"tags"`
	State     TopicState `gorm:"column:state;not null" json:"state"`
	TouchedAt time.Time  `gorm:"column:touched_at" json:"touched_at"`
	CreatedAt time.Time  `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time  `gorm:"column:updated_at;not null" json:"updated_at"`
}

Topic mapped from table <topics>

func (*Topic) TableName

func (*Topic) TableName() string

TableName Topic's table name

type TopicState

type TopicState int

func (TopicState) Value

func (j TopicState) Value() (driver.Value, error)

type TriggerCronRule

type TriggerCronRule struct {
	Spec string `json:"spec"`
}

type TriggerType

type TriggerType string
const (
	TriggerCron    TriggerType = "cron"
	TriggerManual  TriggerType = "manual"
	TriggerWebhook TriggerType = "webhook"
)

func (TriggerType) Value

func (j TriggerType) Value() (driver.Value, error)

type Url

type Url struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Flag      string    `gorm:"column:flag;not null" json:"flag"`
	URL       string    `gorm:"column:url;not null" json:"url"`
	State     UrlState  `gorm:"column:state;not null" json:"state"`
	ViewCount int32     `gorm:"column:view_count;not null" json:"view_count"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

Url mapped from table <urls>

func (*Url) TableName

func (*Url) TableName() string

TableName Url's table name

type UrlState

type UrlState int
const (
	UrlStateUnknown UrlState = iota
	UrlStateEnable
	UrlStateDisable
)

func (UrlState) Value

func (j UrlState) Value() (driver.Value, error)

type User

type User struct {
	ID        int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Flag      string    `gorm:"column:flag;not null" json:"flag"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Tags      string    `gorm:"column:tags" json:"tags"`
	State     UserState `gorm:"column:state;not null" json:"state"`
	CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

User mapped from table <users>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

type UserState

type UserState int
const (
	UserStateUnknown UserState = iota
	UserActive
	UserInactive
)

func (UserState) Value

func (j UserState) Value() (driver.Value, error)

type ValueModeType

type ValueModeType string
const (
	ValueSumMode  ValueModeType = "sum"
	ValueLastMode ValueModeType = "last"
	ValueAvgMode  ValueModeType = "avg"
	ValueMaxMode  ValueModeType = "max"
)

func (ValueModeType) Value

func (j ValueModeType) Value() (driver.Value, error)

type Webhook

type Webhook struct {
	ID           int64        `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID          string       `gorm:"column:uid;not null" json:"uid"`
	Topic        string       `gorm:"column:topic;not null" json:"topic"`
	Flag         string       `gorm:"column:flag;not null" json:"flag"`
	Secret       string       `gorm:"column:secret;not null" json:"secret"`
	TriggerCount int32        `gorm:"column:trigger_count;not null" json:"trigger_count"`
	State        WebhookState `gorm:"column:state;not null" json:"state"`
	CreatedAt    time.Time    `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt    time.Time    `gorm:"column:updated_at;not null" json:"updated_at"`
}

Webhook mapped from table <webhook>

func (*Webhook) TableName

func (*Webhook) TableName() string

TableName Webhook's table name

type WebhookState

type WebhookState int
const (
	WebhookStateUnknown WebhookState = iota
	WebhookActive
	WebhookInactive
)

func (WebhookState) Value

func (j WebhookState) Value() (driver.Value, error)

type Workflow

type Workflow struct {
	ID              int64              `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UID             string             `gorm:"column:uid;not null" json:"uid"`
	Topic           string             `gorm:"column:topic;not null" json:"topic"`
	Flag            string             `gorm:"column:flag;not null" json:"flag"`
	Name            string             `gorm:"column:name;not null" json:"name"`
	Describe        string             `gorm:"column:describe;not null" json:"describe"`
	SuccessfulCount int32              `gorm:"column:successful_count;not null" json:"successful_count"`
	FailedCount     int32              `gorm:"column:failed_count;not null" json:"failed_count"`
	RunningCount    int32              `gorm:"column:running_count;not null" json:"running_count"`
	CanceledCount   int32              `gorm:"column:canceled_count;not null" json:"canceled_count"`
	State           WorkflowState      `gorm:"column:state;not null" json:"state"`
	CreatedAt       time.Time          `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt       time.Time          `gorm:"column:updated_at;not null" json:"updated_at"`
	Dag             []*Dag             `gorm:"foreignKey:workflow_id" json:"dag"`
	Triggers        []*WorkflowTrigger `gorm:"foreignKey:workflow_id" json:"triggers"`
}

Workflow mapped from table <workflow>

func (*Workflow) TableName

func (*Workflow) TableName() string

TableName Workflow's table name

type WorkflowScript

type WorkflowScript struct {
	ID         int64              `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	WorkflowID int64              `gorm:"column:workflow_id;not null" json:"workflow_id"`
	Lang       WorkflowScriptLang `gorm:"column:lang;not null" json:"lang"`
	Code       string             `gorm:"column:code;not null" json:"code"`
	Version    int32              `gorm:"column:version;not null;default:1" json:"version"`
	CreatedAt  time.Time          `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt  time.Time          `gorm:"column:updated_at;not null" json:"updated_at"`
}

WorkflowScript mapped from table <workflow_script>

func (*WorkflowScript) TableName

func (*WorkflowScript) TableName() string

TableName WorkflowScript's table name

type WorkflowScriptLang

type WorkflowScriptLang string
const (
	WorkflowScriptYaml WorkflowScriptLang = "yaml"
)

func (WorkflowScriptLang) Value

func (j WorkflowScriptLang) Value() (driver.Value, error)

type WorkflowState

type WorkflowState int
const (
	WorkflowStateUnknown WorkflowState = iota
	WorkflowEnable
	WorkflowDisable
)

func (WorkflowState) Value

func (j WorkflowState) Value() (driver.Value, error)

type WorkflowTrigger

type WorkflowTrigger struct {
	ID         int64                `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	WorkflowID int64                `gorm:"column:workflow_id;not null" json:"workflow_id"`
	Type       TriggerType          `gorm:"column:type;not null" json:"type"`
	Rule       JSON                 `gorm:"column:rule" json:"rule"`
	Count_     int32                `gorm:"column:count;not null" json:"count"`
	State      WorkflowTriggerState `gorm:"column:state;not null" json:"state"`
	CreatedAt  time.Time            `gorm:"column:created_at;not null" json:"created_at"`
	UpdatedAt  time.Time            `gorm:"column:updated_at;not null" json:"updated_at"`
}

WorkflowTrigger mapped from table <workflow_trigger>

func (*WorkflowTrigger) TableName

func (*WorkflowTrigger) TableName() string

TableName WorkflowTrigger's table name

type WorkflowTriggerState

type WorkflowTriggerState int
const (
	WorkflowTriggerStateUnknown WorkflowTriggerState = iota
	WorkflowTriggerEnable
	WorkflowTriggerDisable
)

func (WorkflowTriggerState) Value

func (j WorkflowTriggerState) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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