Documentation ¶
Index ¶
- Constants
- func ActionMsg(_ types.Context, id string) types.MsgPayload
- func AppURL(ctx types.Context, name string, param types.KV) string
- func Behavior(uid types.Uid, flag string, number int)
- func Bootstrap() error
- func CreateShortUrl(text string) (string, error)
- func Cron(...) ([]*cron.Ruleset, error)
- func FormMsg(ctx types.Context, id string) types.MsgPayload
- func Help(rules []interface{}) (map[string][]string, error)
- func HelpPipeline(pipelineRules []pipeline.Rule, _ types.Context, _ types.KV, ...) (types.MsgPayload, error)
- func Init(jsonconf json.RawMessage) error
- func InstructMsg(ctx types.Context, id string, data types.KV) types.MsgPayload
- func List() map[string]Handler
- func PageURL(ctx types.Context, pageRuleId string, param types.KV, ...) (string, error)
- func ProcessPipeline(ctx types.Context, pipelineRule pipeline.Rule, index int) (types.MsgPayload, error)
- func Register(name string, bot Handler)
- func RunAction(actionRules []action.Rule, ctx types.Context, option string) (types.MsgPayload, error)
- func RunAgent(agentVersion int, agentRules []agent.Rule, ctx types.Context, content types.KV) (types.MsgPayload, error)
- func RunCommand(commandRules []command.Rule, ctx types.Context, content interface{}) (types.MsgPayload, error)
- func RunCondition(conditionRules []condition.Rule, ctx types.Context, forwarded types.MsgPayload) (types.MsgPayload, error)
- func RunCron(cronRules []cron.Rule, name string, send types.SendFunc) (*cron.Ruleset, error)
- func RunForm(formRules []form.Rule, ctx types.Context, values types.KV) (types.MsgPayload, error)
- func RunGroup(eventRules []event.Rule, ctx types.Context, head types.KV, content interface{}) (types.MsgPayload, error)
- func RunPage(pageRules []page.Rule, ctx types.Context, flag string) (string, error)
- func RunPipeline(pipelineRules []pipeline.Rule, ctx types.Context, head types.KV, ...) (types.MsgPayload, string, int, error)
- func RunSession(sessionRules []session.Rule, ctx types.Context, content interface{}) (types.MsgPayload, error)
- func RunWebhook(webhookRules []webhook.Rule, ctx types.Context, content types.KV) (types.MsgPayload, error)
- func RunWorkflow(workflowRules []workflow.Rule, ctx types.Context, input types.KV) (types.KV, error)
- func ServeFile(rw http.ResponseWriter, req *http.Request, dist embed.FS, dir string)
- func ServiceURL(ctx types.Context, group, path string, param types.KV) string
- func SessionDone(ctx types.Context)
- func SessionMsg(ctx types.Context, id string, data types.KV) types.MsgPayload
- func SessionStart(ctx types.Context, initValues types.KV) error
- func SetPipelineState(ctx types.Context, flag string, state model.PipelineState) error
- func SetPipelineStep(ctx types.Context, flag string, index int) error
- func SettingCovertForm(id string, rule setting.Rule) form.Rule
- func SettingGet(ctx types.Context, id string, key string) (types.KV, error)
- func SettingMsg(ctx types.Context, id string) types.MsgPayload
- func StoreForm(ctx types.Context, payload types.MsgPayload) types.MsgPayload
- func StoreInstruct(ctx types.Context, payload types.MsgPayload) types.MsgPayload
- func StorePage(ctx types.Context, category model.PageType, title string, ...) types.MsgPayload
- func StoreParameter(params types.KV, expiredAt time.Time) (string, error)
- func StorePipeline(ctx types.Context, pipelineRule pipeline.Rule, index int) (string, error)
- func TriggerPipeline(pipelineRules []pipeline.Rule, ctx types.Context, _ types.KV, ...) (string, pipeline.Rule, error)
- func Webservice(app *fiber.App, name string, ruleset webservice.Ruleset)
- type Base
- func (Base) Action(_ types.Context, _ string) (types.MsgPayload, error)
- func (Base) Agent(_ types.Context, _ types.KV) (types.MsgPayload, error)
- func (Base) Bootstrap() error
- func (Base) Command(_ types.Context, _ interface{}) (types.MsgPayload, error)
- func (Base) Condition(_ types.Context, _ types.MsgPayload) (types.MsgPayload, error)
- func (Base) Cron(_ types.SendFunc) (*cron.Ruleset, error)
- func (Base) Form(_ types.Context, _ types.KV) (types.MsgPayload, error)
- func (Base) Group(_ types.Context, _ types.KV, _ interface{}) (types.MsgPayload, error)
- func (b Base) Help() (map[string][]string, error)
- func (Base) Input(_ types.Context, _ types.KV, _ interface{}) (types.MsgPayload, error)
- func (Base) Instruct() (instruct.Ruleset, error)
- func (Base) OnEvent() error
- func (Base) Page(_ types.Context, _ string) (string, error)
- func (Base) Pipeline(_ types.Context, _ types.KV, _ interface{}, _ types.PipelineOperate) (types.MsgPayload, string, int, error)
- func (Base) Rules() []interface{}
- func (Base) Session(_ types.Context, _ interface{}) (types.MsgPayload, error)
- func (Base) WebService() *restful.WebService
- func (Base) Webapp() func(rw http.ResponseWriter, req *http.Request)
- func (Base) Webhook(_ types.Context, _ types.KV) (types.MsgPayload, error)
- func (Base) Webservice(_ *fiber.App)
- func (Base) Workflow(_ types.Context, _ types.KV) (types.KV, error)
- type Handler
Constants ¶
View Source
const ( MessageBotIncomingBehavior = "message_bot_incoming" MessageGroupIncomingBehavior = "message_group_incoming" )
Variables ¶
This section is empty.
Functions ¶
func CreateShortUrl ¶
func Cron ¶
func Cron(send func(rcptTo string, uid types.Uid, out types.MsgPayload, option ...interface{})) ([]*cron.Ruleset, error)
Cron registered handlers
func HelpPipeline ¶
func InstructMsg ¶
func ProcessPipeline ¶
func RunCommand ¶
func RunCondition ¶
func RunCondition(conditionRules []condition.Rule, ctx types.Context, forwarded types.MsgPayload) (types.MsgPayload, error)
func RunPipeline ¶
func RunSession ¶
func RunWebhook ¶
func RunWorkflow ¶
func SessionDone ¶
func SessionMsg ¶
func SetPipelineState ¶
func SettingMsg ¶
func SettingMsg(ctx types.Context, id string) types.MsgPayload
func StoreForm ¶
func StoreForm(ctx types.Context, payload types.MsgPayload) types.MsgPayload
func StoreInstruct ¶
func StoreInstruct(ctx types.Context, payload types.MsgPayload) types.MsgPayload
func StorePage ¶
func StorePage(ctx types.Context, category model.PageType, title string, payload types.MsgPayload) types.MsgPayload
func StorePipeline ¶
func TriggerPipeline ¶
func Webservice ¶
func Webservice(app *fiber.App, name string, ruleset webservice.Ruleset)
Types ¶
type Base ¶
type Base struct{}
func (Base) Condition ¶
func (Base) Condition(_ types.Context, _ types.MsgPayload) (types.MsgPayload, error)
func (Base) WebService ¶
func (Base) WebService() *restful.WebService
func (Base) Webservice ¶
func (Base) Webservice(_ *fiber.App)
type Handler ¶
type Handler interface { // Init initializes the bot. Init(jsonconf json.RawMessage) error // IsReady сhecks if the bot is initialized. IsReady() bool // Bootstrap Lifecycle hook Bootstrap() error // OnEvent event OnEvent() error // Help return bot help Help() (map[string][]string, error) // Rules return bot ruleset Rules() []interface{} // Input return input result Input(ctx types.Context, head types.KV, content interface{}) (types.MsgPayload, error) // Command return bot result Command(ctx types.Context, content interface{}) (types.MsgPayload, error) // Form return bot form result Form(ctx types.Context, values types.KV) (types.MsgPayload, error) // Action return bot action result Action(ctx types.Context, option string) (types.MsgPayload, error) // Session return bot session result Session(ctx types.Context, content interface{}) (types.MsgPayload, error) // Cron cron script daemon Cron(send types.SendFunc) (*cron.Ruleset, error) // Condition run conditional process Condition(ctx types.Context, forwarded types.MsgPayload) (types.MsgPayload, error) // Group return group result Group(ctx types.Context, head types.KV, content interface{}) (types.MsgPayload, error) // Pipeline return pipeline result Pipeline(ctx types.Context, head types.KV, content interface{}, operate types.PipelineOperate) (types.MsgPayload, string, int, error) // Agent return group result Agent(ctx types.Context, content types.KV) (types.MsgPayload, error) // Instruct return instruct list Instruct() (instruct.Ruleset, error) // Page return page Page(ctx types.Context, flag string) (string, error) // Webservice return webservice routes Webservice(app *fiber.App) // Webapp return webapp Webapp() func(rw http.ResponseWriter, req *http.Request) // Workflow return workflow result Workflow(ctx types.Context, input types.KV) (types.KV, error) // Webhook return webhook result Webhook(ctx types.Context, content types.KV) (types.MsgPayload, error) }
Click to show internal directories.
Click to hide internal directories.