chatbot

package
v0.0.0-...-b925956 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RULE_ROBOT_TULING = "tuling"
)

Variables

View Source
var (
	DefaultTransportInsecureSkipVerify bool = true
	DefaultTransportDisableCompression bool = true
)

Functions

This section is empty.

Types

type ApplyRuleResult

type ApplyRuleResult struct {
	MerchantNo string `json:"merchant_no"`
	RuleId     string `json:"rule_id"`
	Type       string `json:"type"`
	RobotId    int    `json:"robot_id"`
	Params     string `json:"params"`
	Status     bool   `json:"status"`
}

type Client

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

func NewClient

func NewClient(config *ClientConfig) *Client

func (*Client) Action

func (c *Client) Action(path, method string, params map[string]interface{}) *Result

func (*Client) ApplyRule

func (c *Client) ApplyRule(ruleId, ruleType string) (rst *ApplyRuleResult, err error)

func (*Client) SendMessage

func (c *Client) SendMessage(ruleId, ruleType, msg, userId string) (rst *SendMessageResult, err error)

type ClientConfig

type ClientConfig struct {
	ApiHost        string
	MerchantNo     string
	MerchantSecret string
}

type Result

type Result struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data"`
	Error  string      `json:"error"`
}

type SendMessageResult

type SendMessageResult struct {
	Code    int                      `json:"code"`
	UserId  string                   `json:"user_id"`
	Text    string                   `json:"text"`
	Url     string                   `json:"url"`
	List    []map[string]interface{} `json:"list"`
	Proetry map[string]interface{}   `json:"proerty"`
}

Jump to

Keyboard shortcuts

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