chatbotada

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExcelColumnType2String added in v0.2.23

func ExcelColumnType2String(ect ExcelColumnType) string

ExcelColumnType2String - ExcelColumnType -> string

func GetComments added in v0.2.23

func GetComments(f *excelize.File, sheetName string) map[string]string

GetComments - get comments with sheetName

func GetStartXY added in v0.2.23

func GetStartXY(arr [][]string) (int, int)

GetStartXY - get start x & y

func HasDuplication added in v0.2.23

func HasDuplication(arr [][]string, x int) bool

HasDuplication - is there no duplication?

func ProcHead added in v0.2.23

func ProcHead(arr [][]string, sx int, sy int) [][]string

ProcHead - process head

func StartChatBot added in v0.2.7

func StartChatBot(ctx context.Context, adacorecfgfn string, chatbotcfgfn string) error

StartChatBot - start chatbot

Types

type DebugExcelColumnType added in v0.2.23

type DebugExcelColumnType struct {
	Name      string
	Type      string
	TypeAuto  string
	Separator string
}

DebugExcelColumnType - excel column type

type ExcelCellType added in v0.2.23

type ExcelCellType int32

ExcelCellType - excel cell type

const (
	// CellInvalid - invalid
	CellInvalid ExcelCellType = -1
	// CellString - string
	CellString ExcelCellType = 0
	// CellInt32 - int32
	CellInt32 ExcelCellType = 1
	// CellInt64 - int64
	CellInt64 ExcelCellType = 2
	// CellFloat32 - float32
	CellFloat32 ExcelCellType = 3
	// CellFloat64 - float64
	CellFloat64 ExcelCellType = 4
	// CellPercentage - percentage
	CellPercentage ExcelCellType = 5
	// CellNull - null
	CellNull ExcelCellType = 6
)

func AnalysisCell added in v0.2.23

func AnalysisCell(arr [][]string, x int, sy int) ExcelCellType

AnalysisCell - analysis cell, exclude rows with y <= sy

type ExcelColumnType added in v0.2.23

type ExcelColumnType int32

ExcelColumnType - excel column type

const (
	// ColumnInfo - info
	ColumnInfo ExcelColumnType = 0
	// ColumnNumberPrimaryKey - number primary key
	ColumnNumberPrimaryKey ExcelColumnType = 1
	// ColumnPrimaryKey - primary key
	ColumnPrimaryKey ExcelColumnType = 2
	// ColumnDataTime - data time
	ColumnDataTime ExcelColumnType = 3
	// ColumnNumber - number
	ColumnNumber ExcelColumnType = 4
	// ColumnPercentage - percentage
	ColumnPercentage ExcelColumnType = 5
	// ColumnIgnorePrimaryKey - ignore primary key
	ColumnIgnorePrimaryKey ExcelColumnType = 6
	// ColumnCategory - category
	ColumnCategory ExcelColumnType = 7
	// ColumnInt - int
	ColumnInt ExcelColumnType = 8
	// ColumnTimestamp - timestamp
	ColumnTimestamp ExcelColumnType = 9
	// ColumnTimestampMs - timestampms
	ColumnTimestampMs ExcelColumnType = 10
	// ColumnNull - null
	ColumnNull ExcelColumnType = 11
	// ColumnTreeCategory - tree category
	ColumnTreeCategory ExcelColumnType = 12
	// ColumnIgnore - ignore
	ColumnIgnore ExcelColumnType = 13
	// ColumnMultiCategories - multiple categories
	ColumnMultiCategories ExcelColumnType = 14
)

func AnalysisColumn added in v0.2.23

func AnalysisColumn(arr [][]string, x int, sy int) ExcelColumnType

AnalysisColumn - analysis column, exclude rows with y == 0

func AnalysisColumnsType added in v0.2.23

func AnalysisColumnsType(arr [][]string, sx int, sy int) []ExcelColumnType

AnalysisColumnsType - analysis column type

type ExcelColumnTypeObj added in v0.2.23

type ExcelColumnTypeObj struct {
	Name      string
	Type      ExcelColumnType
	Separator string
}

ExcelColumnTypeObj - excel column type object

func AnalysisColumnsTypeWithComments added in v0.2.23

func AnalysisColumnsTypeWithComments(arr [][]string, sx int, sy int,
	mapComments map[string]string) []ExcelColumnTypeObj

AnalysisColumnsTypeWithComments - analysis ColumnsType with comments

type ExcelData added in v0.2.23

type ExcelData struct {
	StartX       int
	StartY       int
	Columns      []ExcelColumnTypeObj
	ColumnsAuto  []ExcelColumnType
	Arr          [][]string
	CurSheetName string
}

ExcelData - excel data

func ProcExcelMsg added in v0.2.23

func ProcExcelMsg(chat *chatbotpb.ChatMsg) (*ExcelData, error)

ProcExcelMsg - analysis chatmsg to ExcelData

type ServiceCore

type ServiceCore struct {
}

ServiceCore - chatbot service core

func (*ServiceCore) NewAppData

func (core *ServiceCore) NewAppData() (proto.Message, error)

NewAppData - new a app data

func (*ServiceCore) NewUserData

func (core *ServiceCore) NewUserData(ui *chatbotpb.UserInfo) (proto.Message, error)

NewUserData - new a userdata

func (*ServiceCore) OnDebug added in v0.2.23

func (core *ServiceCore) OnDebug(ctx context.Context, serv *chatbot.Serv, chat *chatbotpb.ChatMsg,
	ui *chatbotpb.UserInfo, ud proto.Message) ([]*chatbotpb.ChatMsg, error)

OnDebug - call in plugin.debug

func (*ServiceCore) UnmarshalAppData

func (core *ServiceCore) UnmarshalAppData(buf []byte) (proto.Message, error)

UnmarshalAppData - unmarshal

func (*ServiceCore) UnmarshalUserData

func (core *ServiceCore) UnmarshalUserData(buf []byte) (proto.Message, error)

UnmarshalUserData - unmarshal

Jump to

Keyboard shortcuts

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