test

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenDate

func GenDate() string

* * 生成测试数据库的文件名 *

func HttpGet

func HttpGet(api string) string

func HttpPost

func HttpPost(data map[string]interface{}, url string) string

func LoadUnitTestDB added in v0.6.1

func LoadUnitTestDB()

func MKDir

func MKDir(dirName string) error

* * 创建文件夹 *

func RmUnitTestDbFile

func RmUnitTestDbFile(t *testing.T)

* * 删除之前的文件 *

func RunTestEngine

func RunTestEngine() typex.RuleX

* * 起一个测试服务 *

func StartTestServer

func StartTestServer(t *testing.T)

* * 启动一个测试服 *

func Start_nats_listener

func Start_nats_listener()

* * 监听器 *

func Test_AIBASE_ANN_MNIST

func Test_AIBASE_ANN_MNIST(t *testing.T)

Types

type Action

type Action struct {
	ID       string   `json:"id"`
	Name     string   `json:"name"`
	Desc     string   `json:"desc"`
	Input    []Input  `json:"input"`
	Output   []Output `json:"output"`
	Required bool     `json:"required"`
}

type Define

type Define struct {
	Type  string `json:"type"`
	Specs []Spec `json:"specs"`
}

type Event

type Event struct {
	ID       string  `json:"id"`
	Name     string  `json:"name"`
	Desc     string  `json:"desc"`
	Type     string  `json:"type"`
	Params   []Param `json:"params"`
	Required bool    `json:"required"`
}

type InDefine

type InDefine struct {
	Type    string  `json:"type"`
	Mapping Mapping `json:"mapping"`
}

type Input

type Input struct {
	ID     string   `json:"id"`
	Name   string   `json:"name"`
	Define InDefine `json:"define"`
}

type Mapping

type Mapping struct {
	Type  string
	Value string
}

type OutDefine

type OutDefine struct {
	Type    string  `json:"type"`
	Mapping Mapping `json:"mapping"`
}

type Output

type Output struct {
	ID     string    `json:"id"`
	Name   string    `json:"name"`
	Define OutDefine `json:"define"`
}

type Param

type Param struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Define Define `json:"define"`
}

type Profile

type Profile struct {
	ProductID  string `json:"ProductId"`
	CategoryID string `json:"CategoryId"`
}

type Property

type Property struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Desc     string `json:"desc"`
	Mode     string `json:"mode"`
	Define   Define `json:"define"`
	Required bool   `json:"required"`
}

type Schema

type Schema struct {
	Version        string     `json:"version"`        // 版本
	Profile        Profile    `json:"profile"`        // 物的元描述
	Configurations []Property `json:"configurations"` // 配置
	Properties     []Property `json:"properties"`     // 属性
	Events         []Event    `json:"events"`         // 事件
	Actions        []Action   `json:"actions"`        // 动作
}

type Spec

type Spec []struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	DataType struct {
		Type    string  `json:"type"`
		Mapping Mapping `json:"mapping"`
	} `json:"dataType"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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