generatecode

package
v0.0.0-...-ff14b99 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TplCard = `` /* 747-byte string literal not displayed */
View Source
var TplEvent = `` /* 1004-byte string literal not displayed */
View Source
var TplGinCallback = `` /* 2013-byte string literal not displayed */
View Source
var TplGinMain = `` /* 1992-byte string literal not displayed */
View Source
var TplRegist = `` /* 1082-byte string literal not displayed */

Functions

func FormatFuncName

func FormatFuncName(s string) string

func GenerateCode

func GenerateCode(ctx context.Context, tplName, tplStr, path, file string, tpl interface{}, isForceUpdate bool) error

func InitPath

func InitPath(path string) error

Types

type BotCommand

type BotCommand struct {
	Cmd         string
	FuncName    string
	Description string
}

type CardAction

type CardAction struct {
	MethodName string
	FuncName   string
}

type CardConf

type CardConf struct {
	MethodName string `yaml:"MethodName"`
}

type CommandConf

type CommandConf struct {
	Cmd         string `yaml:"Cmd"`
	Description string `yaml:"Description"`
}

type Event

type Event struct {
	EventName string
}

type EventConf

type EventConf struct {
	EventName string `yaml:"EventName"`
}

type EventTemplate

type EventTemplate struct {
	EventList  []Event      // event
	BotCmdList []BotCommand // bot recv msg
	CardList   []CardAction // bot recv msg
	UseJson    bool
	UseAuth    bool
}

event template

func (*EventTemplate) AddBotCommand

func (tpl *EventTemplate) AddBotCommand(cmd, description string)

func (*EventTemplate) AddCardAction

func (tpl *EventTemplate) AddCardAction(name string)

func (*EventTemplate) AddEvent

func (tpl *EventTemplate) AddEvent(name string)

type GenCodeInfo

type GenCodeInfo struct {
	ServiceInfo    ServiceInfoConf `yaml:"ServiceInfo"`
	EventList      []EventConf     `yaml:"EventList"`
	CommandList    []CommandConf   `yaml:"CommandList"`
	CardActionList []CardConf      `yaml:"CardActionList"`
}

type MainTemplate

type MainTemplate struct {
	Path         string
	GenCodePath  string
	EventWebhook string
	CardWebhook  string
	AppID        string
	IsISVApp     bool
}

type ServiceInfoConf

type ServiceInfoConf struct {
	Path         string `yaml:"Path"`
	GenCodePath  string `yaml:"GenCodePath"`
	EventWebhook string `yaml:"EventWebhook"`
	CardWebhook  string `yaml:"CardWebhook"`
	AppID        string `yaml:"AppID"`
	Description  string `yaml:"Description"`
	IsISVApp     bool   `yaml:"IsISVApp"`
}

Jump to

Keyboard shortcuts

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