api

package
v0.1.72 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	APIAuthTypeNone      = "none"
	APIAuthTypeBasicAuth = "basicAuth"
	APIAuthTypeKeyAuth   = "keyAuth"
)

认证类型

View Source
const (
	APIMockFormatJSON = "json"
	APIMockFormatXML  = "xml"
	APIMockFormatText = "text"
	APIMockFormatFile = "file"
)

API的mock格式定义

View Source
const (
	APIStatusTypeNormal  = "normal"
	APIStatusTypeSuccess = "success"
	APIStatusTypeWarning = "warning"
	APIStatusTypeFailure = "failure"
	APIStatusTypeError   = "error"
)

API状态常量

Variables

View Source
var SharedApiWatching = NewApiWatching()

Functions

func AllAuthTypes

func AllAuthTypes() []maps.Map

所有认证类型

func AllStatusTypes

func AllStatusTypes() []maps.Map

所有的状态

func ContainsAuthType

func ContainsAuthType(authType string) bool

检查认证类型是否存在

func FindAuthTypeName

func FindAuthTypeName(authType string) string

获取认证类型名

Types

type API

type API struct {
	shared.HeaderList

	Filename       string      `yaml:"filename" json:"filename"`             // 文件名
	Path           string      `yaml:"path" json:"path"`                     // 访问路径
	Address        string      `yaml:"address" json:"address"`               // 实际地址
	Methods        []string    `yaml:"methods" json:"methods"`               // 方法
	Params         []*APIParam `yaml:"params" json:"params"`                 // 参数
	Name           string      `yaml:"name" json:"name"`                     // 名称
	Description    string      `yaml:"description" json:"description"`       // 描述
	MockFiles      []string    `yaml:"mockFiles" json:"mockFiles"`           // 假数据文件(Mock)
	MockOn         bool        `yaml:"mockOn" json:"mockOn"`                 // 是否开启Mock
	Author         string      `yaml:"author" json:"author"`                 // 作者
	Company        string      `yaml:"company" json:"company"`               // 公司或团队
	IsAsynchronous bool        `yaml:"isAsynchronous" json:"isAsynchronous"` // TODO
	Timeout        float64     `yaml:"timeout" json:"timeout"`               // TODO
	MaxSize        uint        `yaml:"maxSize" json:"maxSize"`               // TODO
	TodoThings     []string    `yaml:"todo" json:"todo"`                     // 待做事宜
	DoneThings     []string    `yaml:"done" json:"done"`                     // 已完成事宜
	Response       []byte      `yaml:"response" json:"response"`             // 响应内容 TODO
	IsDeprecated   bool        `yaml:"isDeprecated" json:"isDeprecated"`     // 是否过期
	On             bool        `yaml:"on" json:"on"`                         // 是否开启
	Versions       []string    `yaml:"versions" json:"versions"`             // 版本信息
	ModifiedAt     int64       `yaml:"modifiedAt" json:"modifiedAt"`         // 最后修改时间
	Username       string      `yaml:"username" json:"username"`             // 最后修改用户名
	Groups         []string    `yaml:"groups" json:"groups"`                 // 分组
	Limit          *APILimit   `yaml:"limit" json:"limit"`                   // 限制 TODO
	AuthType       string      `yaml:"authType" json:"authType"`             // 认证方式

	TestScripts   []string `yaml:"testScripts" json:"testScripts"`     // 脚本文件
	TestCaseFiles []string `yaml:"testCaseFiles" json:"testCaseFiles"` // 单元测试存储文件

	CachePolicy string `yaml:"cachePolicy" json:"cachePolicy"` // 缓存策略
	CacheOn     bool   `yaml:"cacheOn" json:"cacheOn"`         // 缓存是否打开 TODO
	// contains filtered or unexported fields
}

API定义

func NewAPI

func NewAPI() *API

获取新API对象

func NewAPIFromFile

func NewAPIFromFile(filename string) *API

从文件中读取API对象

func (*API) AddMock

func (this *API) AddMock(filename string)

添加Mock文件

func (*API) AddParam

func (this *API) AddParam(param *APIParam)

添加参数

func (*API) AddScript

func (this *API) AddScript(script *APIScript)

添加测试脚本

func (*API) AddTestCase

func (this *API) AddTestCase(filename string)

添加测试用例

func (*API) AllowMethod

func (this *API) AllowMethod(method string) bool

是否允许某个请求方法

func (*API) CachePolicyObject

func (this *API) CachePolicyObject() *shared.CachePolicy

缓存策略

func (*API) ChangeGroup

func (this *API) ChangeGroup(oldName string, newName string)

修改API某个分组名

func (*API) ChangeVersion

func (this *API) ChangeVersion(oldName string, newName string)

修改API某个版本号

func (*API) Delete

func (this *API) Delete() error

删除API

func (*API) DeleteMock

func (this *API) DeleteMock(mockFile string)

删除Mock

func (*API) DeleteTestCase

func (this *API) DeleteTestCase(filename string)

删除测试用例

func (*API) DeleteTestScript

func (this *API) DeleteTestScript(filename string) error

删除测试脚本

func (*API) FindTestCases

func (this *API) FindTestCases() []*APITestCase

查找所有的测试用例

func (*API) FindTestScript

func (this *API) FindTestScript(filename string) *APIScript

查找单个脚本

func (*API) FindTestScripts

func (this *API) FindTestScripts() []*APIScript

读取所有测试脚本

func (*API) IsWatching

func (this *API) IsWatching() bool

是否在监控

func (*API) Match

func (this *API) Match(path string) (params map[string]string, matched bool)

使用正则匹配路径

func (*API) MockDataFiles

func (this *API) MockDataFiles() []string

获取所有Mock的文件

func (*API) RandMock

func (this *API) RandMock() *APIMock

随机取得一个Mock

func (*API) RemoveGroup

func (this *API) RemoveGroup(name string)

删除某个分组

func (*API) RemoveVersion

func (this *API) RemoveVersion(name string)

删除某个版本

func (*API) Save

func (this *API) Save() error

保存到文件

func (*API) StartWatching

func (this *API) StartWatching()

开始监控

func (*API) StopWatching

func (this *API) StopWatching()

结束监控

func (*API) Validate

func (this *API) Validate() error

执行校验

type APIAuthBasicAuth

type APIAuthBasicAuth struct {
	Username string
	Password string
}

Basic Auth

func (*APIAuthBasicAuth) KeyFromRequest

func (this *APIAuthBasicAuth) KeyFromRequest(req *http.Request) string

func (*APIAuthBasicAuth) MatchRequest

func (this *APIAuthBasicAuth) MatchRequest(req *http.Request) bool

func (*APIAuthBasicAuth) UniqueKey

func (this *APIAuthBasicAuth) UniqueKey() string

type APIAuthInterface

type APIAuthInterface interface {
	// 唯一Key
	UniqueKey() string

	// 从Request中读取Key
	KeyFromRequest(req *http.Request) string

	// 匹配Request
	MatchRequest(req *http.Request) bool
}

认证接口

func NewAPIAuth

func NewAPIAuth(authType string, options map[string]interface{}) APIAuthInterface

新对象

func NewAPIAuthBasicAuth

func NewAPIAuthBasicAuth(options map[string]interface{}) APIAuthInterface

func NewAPIAuthKeyAuth

func NewAPIAuthKeyAuth(options map[string]interface{}) APIAuthInterface

func NewAPIAuthNoneAuth

func NewAPIAuthNoneAuth(options map[string]interface{}) APIAuthInterface

type APIAuthKeyAuth

type APIAuthKeyAuth struct {
	Key         string
	HeaderField string
	FormField   string
}

Key Auth

func (*APIAuthKeyAuth) KeyFromRequest

func (this *APIAuthKeyAuth) KeyFromRequest(req *http.Request) string

func (*APIAuthKeyAuth) MatchRequest

func (this *APIAuthKeyAuth) MatchRequest(req *http.Request) bool

func (*APIAuthKeyAuth) UniqueKey

func (this *APIAuthKeyAuth) UniqueKey() string

type APIAuthNoneAuth

type APIAuthNoneAuth struct {
}

默认认证(无认证)

func (*APIAuthNoneAuth) KeyFromRequest

func (this *APIAuthNoneAuth) KeyFromRequest(req *http.Request) string

func (*APIAuthNoneAuth) MatchRequest

func (this *APIAuthNoneAuth) MatchRequest(req *http.Request) bool

func (*APIAuthNoneAuth) UniqueKey

func (this *APIAuthNoneAuth) UniqueKey() string

type APIConfig

type APIConfig struct {
	On             bool         `yaml:"on" json:"on"`                         // 是否开启API功能
	Files          []string     `yaml:"files" json:"files"`                   // API文件列表
	Groups         []string     `yaml:"groups" json:"groups"`                 // API分组
	Versions       []string     `yaml:"versions" json:"versions"`             // API版本
	TestPlans      []string     `yaml:"testPlans" json:"testPlans"`           // API测试计划
	StatusList     []*APIStatus `yaml:"status" json:"status"`                 // 状态码列表
	StatusScriptOn bool         `yaml:"statusScriptOn" json:"statusScriptOn"` // 是否开启状态码分析脚本
	StatusScript   string       `yaml:"statusScript" json:"statusScript"`     // 状态码分析脚本
	MockOn         bool         `yaml:"mockOn" json:"mockOn"`                 // 是否开启Mock
	ConsumerFiles  []string     `yaml:"consumerFiles" json:"consumerFiles"`   // 消费者(调用的开发者)
	// contains filtered or unexported fields
}

服务的API配置

func NewAPIConfig

func NewAPIConfig() *APIConfig

获取新对象

func (*APIConfig) AddAPI

func (this *APIConfig) AddAPI(api *API)

添加API

func (*APIConfig) AddAPIGroup

func (this *APIConfig) AddAPIGroup(name string)

添加API分组

func (*APIConfig) AddAPIVersion

func (this *APIConfig) AddAPIVersion(name string)

添加API版本

func (*APIConfig) AddConsumer

func (this *APIConfig) AddConsumer(consumerFile string)

添加consumer

func (*APIConfig) AddStatus

func (this *APIConfig) AddStatus(status *APIStatus)

添加状态

func (*APIConfig) AddTestPlan

func (this *APIConfig) AddTestPlan(filename string)

添加测试计划

func (*APIConfig) ChangeAPIGroup

func (this *APIConfig) ChangeAPIGroup(oldName string, newName string)

修改API分组

func (*APIConfig) ChangeAPIVersion

func (this *APIConfig) ChangeAPIVersion(oldName string, newName string)

修改API版本

func (*APIConfig) DeleteAPI

func (this *APIConfig) DeleteAPI(api *API)

删除API

func (*APIConfig) DeleteConsumer

func (this *APIConfig) DeleteConsumer(consumerFile string)

删除consumer

func (*APIConfig) DeleteTestPlan

func (this *APIConfig) DeleteTestPlan(filename string) error

删除某个测试计划

func (*APIConfig) ExistStatusCode

func (this *APIConfig) ExistStatusCode(code string) bool

判断状态代号是否存在

func (*APIConfig) FindAPI

func (this *APIConfig) FindAPI(path string) *API

获取单个API信息

func (*APIConfig) FindAPIStatus

func (this *APIConfig) FindAPIStatus(code string) *APIStatus

根据代号查找状态码

func (*APIConfig) FindActiveAPI

func (this *APIConfig) FindActiveAPI(path string, method string) (api *API, params map[string]string)

查找激活状态中的API

func (*APIConfig) FindAllAPIs

func (this *APIConfig) FindAllAPIs() []*API

获取所有APIs

func (*APIConfig) FindAllConsumers

func (this *APIConfig) FindAllConsumers() []*APIConsumer

查询所有的Consumer

func (*APIConfig) FindAllRunningConsumers

func (this *APIConfig) FindAllRunningConsumers() []*APIConsumer

查询所有正在运行的Consumer

func (*APIConfig) FindConsumerForRequest

func (this *APIConfig) FindConsumerForRequest(authType string, req *http.Request) (consumer *APIConsumer, authorized bool)

查找某个认证类型的Consumer

func (*APIConfig) FindTestPlans

func (this *APIConfig) FindTestPlans() []*APITestPlan

查找所有测试计划

func (*APIConfig) MoveAPIStatus

func (this *APIConfig) MoveAPIStatus(fromIndex int, toIndex int)

移动位置

func (*APIConfig) MoveDownAPIGroup

func (this *APIConfig) MoveDownAPIGroup(name string)

把API分组往下调整

func (*APIConfig) MoveDownAPIStatus

func (this *APIConfig) MoveDownAPIStatus(code string)

把API分组往下调整

func (*APIConfig) MoveDownAPIVersion

func (this *APIConfig) MoveDownAPIVersion(name string)

把API版本往下调整

func (*APIConfig) MoveUpAPIGroup

func (this *APIConfig) MoveUpAPIGroup(name string)

把API分组往上调整

func (*APIConfig) MoveUpAPIStatus

func (this *APIConfig) MoveUpAPIStatus(code string)

把状态码往上调整

func (*APIConfig) MoveUpAPIVersion

func (this *APIConfig) MoveUpAPIVersion(name string)

把API版本往上调整

func (*APIConfig) RefreshStatusMap

func (this *APIConfig) RefreshStatusMap()

刷新状态码Map

func (*APIConfig) ReloadConsumers

func (this *APIConfig) ReloadConsumers()

刷新Consumers

func (*APIConfig) RemoveAPIGroup

func (this *APIConfig) RemoveAPIGroup(name string)

删除API分组

func (*APIConfig) RemoveAPIVersion

func (this *APIConfig) RemoveAPIVersion(name string)

删除API版本

func (*APIConfig) RemoveStatus

func (this *APIConfig) RemoveStatus(code string)

移除状态码

func (*APIConfig) UpdateAPI

func (this *APIConfig) UpdateAPI(api *API)

更新API

func (*APIConfig) Validate

func (this *APIConfig) Validate() error

校验

type APIConsumer

type APIConsumer struct {
	Filename string `yaml:"filename" json:"filename"` // 文件名
	On       bool   `yaml:"on" json:"on"`             // 是否开启 TODO
	Name     string `yaml:"name" json:"name"`         // 名称

	// 认证
	Auth struct {
		On      bool                   `yaml:"on" json:"on"`           // 是否开启 TODO
		Type    string                 `yaml:"type" json:"type"`       // 类型
		Options map[string]interface{} `yaml:"options" json:"options"` // 选项
	} `yaml:"auth" json:"auth"`

	// API控制
	API struct {
		On       bool     `yaml:"on" json:"on"`             // 是否开启
		AllowAll bool     `yaml:"allowAll" json:"allowAll"` // 是否允许所有
		DenyAll  bool     `yaml:"denyAll" json:"denyAll"`   // 是否禁止所有
		Allow    []string `yaml:"allow" json:"allow"`       // 允许的API
		Deny     []string `yaml:"deny" json:"deny"`         // 禁止的API
	} `yaml:"api" json:"api"` // API控制

	Policy shared.AccessPolicy `yaml:"policy" json:"policy"` // 控制策略
}

API consumer

func NewAPIConsumer

func NewAPIConsumer() *APIConsumer

获取新对象

func NewAPIConsumerFromFile

func NewAPIConsumerFromFile(filename string) *APIConsumer

从文件中加载对象

func (*APIConsumer) AllowAPI

func (this *APIConsumer) AllowAPI(apiPath string) (passed bool)

消费API

func (*APIConsumer) Delete

func (this *APIConsumer) Delete() error

删除

func (*APIConsumer) Save

func (this *APIConsumer) Save() error

保存

func (*APIConsumer) Validate

func (this *APIConsumer) Validate() error

校验

type APIDataLimit

type APIDataLimit struct {
	Max      uint   `yaml:"max" json:"max"`           // 最大数据量 TODO
	Total    uint   `yaml:"total" json:"total"`       // 数据量 TODO
	Duration string `yaml:"duration" json:"duration"` // 数据限制间隔 TODO
	// contains filtered or unexported fields
}

api数据量限制

func (*APIDataLimit) Validate

func (this *APIDataLimit) Validate() error

校验

type APILimit

type APILimit struct {
	Concurrent    uint               `yaml:"concurrent" json:"concurrent"` // 并发数
	RequestLimits []*APIRequestLimit `yaml:"request" json:"request"`       // 请求数限制 TODO
	DataLimits    []*APIDataLimit    `yaml:"data" json:"data"`             // 数据量限制 TODO
	// contains filtered or unexported fields
}

API限制

func NewAPILimit

func NewAPILimit() *APILimit

获取新的对象

func (*APILimit) Begin

func (this *APILimit) Begin()

等待并发

func (*APILimit) Done

func (this *APILimit) Done()

func (*APILimit) Validate

func (this *APILimit) Validate() error

校验

type APIMock

type APIMock struct {
	Filename  string     `yaml:"filename" json:"filename"`   // 保存的文件名
	On        bool       `yaml:"on" json:"on"`               // 是否开启
	Headers   []maps.Map `yaml:"headers" json:"headers"`     // 输出的Header
	Format    string     `yaml:"format" json:"format"`       // 格式
	Text      string     `yaml:"text" json:"text"`           // 文本
	File      string     `yaml:"file" json:"file"`           // 文件名,一般是和文本二选一
	Username  string     `yaml:"username" json:"username"`   // 创建的用户名
	CreatedAt int64      `yaml:"createdAt" json:"createdAt"` // 创建时间
}

API Mock定义

func NewAPIMock

func NewAPIMock() *APIMock

获取新对象

func NewAPIMockFromFile

func NewAPIMockFromFile(filename string) *APIMock

从文件中加载对象

func (*APIMock) Delete

func (this *APIMock) Delete() error

删除

func (*APIMock) Save

func (this *APIMock) Save() error

保存

type APIParam

type APIParam struct {
	Name        string `yaml:"name" json:"name"`
	Type        string `yaml:"type" json:"type"`
	Description string `yaml:"description" json:"description"`
}

API参数定义

type APIRequestLimit

type APIRequestLimit struct {
	Count    uint   `yaml:"count" json:"count"`       // 请求数 TODO
	Duration string `yaml:"duration" json:"duration"` // 请求限制间隔 TODO
	// contains filtered or unexported fields
}

api请求数限制

func (*APIRequestLimit) Validate

func (this *APIRequestLimit) Validate() error

type APIScript

type APIScript struct {
	Filename string `yaml:"filename" json:"filename"` // 脚本路径
	Code     string `yaml:"code" json:"code"`         // 代码
}

脚本定义

func NewAPIScript

func NewAPIScript() *APIScript

获取新脚本

func (*APIScript) Delete

func (this *APIScript) Delete() error

删除

func (*APIScript) Save

func (this *APIScript) Save() error

保存

type APIStatus

type APIStatus struct {
	Code        string   `yaml:"code" json:"code"`               // 代码
	Description string   `yaml:"description" json:"description"` // 描述
	Groups      []string `yaml:"groups" json:"groups"`           // 分组
	Versions    []string `yaml:"versions" json:"versions"`       // 版本
	Type        string   `yaml:"type" json:"type"`               // 类型
}

API状态定义

func NewAPIStatus

func NewAPIStatus() *APIStatus

获取新对象

func (*APIStatus) TypeName

func (this *APIStatus) TypeName() string

获取当前的状态类型名称

type APITestCase

type APITestCase struct {
	Filename     string     `yaml:"filename" json:"filename"`         // 文件名
	Name         string     `yaml:"name" json:"name"`                 // 名称
	Domain       string     `yaml:"domain" json:"domain"`             // 域名
	Method       string     `yaml:"method" json:"method"`             // 方法
	Query        string     `yaml:"query" json:"query"`               // URL附加参数
	Headers      []maps.Map `yaml:"headers" json:"headers"`           // Header
	Params       []maps.Map `yaml:"params" json:"params"`             // 内置参数
	AttachParams []maps.Map `yaml:"attachParams" json:"attachParams"` // 附加参数
	Format       string     `yaml:"format" json:"format"`             // 响应格式
	Username     string     `yaml:"username" json:"username"`         // 用户名
	CreatedAt    int64      `yaml:"createdAt" json:"createdAt"`       // 创建时间
	UpdatedAt    int64      `yaml:"updatedAt" json:"updatedAt"`       // 更新时间
}

测试历史

func NewAPITestCase

func NewAPITestCase() *APITestCase

获取新对象

func NewAPITestCaseFromFile

func NewAPITestCaseFromFile(filename string) *APITestCase

从文件中加载对象

func (*APITestCase) Delete

func (this *APITestCase) Delete() error

删除

func (*APITestCase) Save

func (this *APITestCase) Save() error

保存到文件

type APITestPlan

type APITestPlan struct {
	On       bool     `yaml:"on" json:"on"`             // 是否开启
	Filename string   `yaml:"filename" json:"filename"` // 配置文件名
	Hour     int      `yaml:"hour" json:"hour"`         // 小时
	Minute   int      `yaml:"minute" json:"minute"`     // 分钟
	Second   int      `yaml:"second" json:"second"`     // 秒
	Weekdays []int    `yaml:"weekdays" json:"weekdays"` // 周
	Reports  []string `yaml:"reports" json:"reports"`   // 报告文件名
	APIs     []string `yaml:"apis" json:"apis"`         // 参与计划的API TODO 需要实现
}

API测试计划

func NewAPITestPlan

func NewAPITestPlan() *APITestPlan

获取新对象

func NewAPITestPlanFromFile

func NewAPITestPlanFromFile(filename string) *APITestPlan

从文件中加载测试计划

func (*APITestPlan) AddReport

func (this *APITestPlan) AddReport(reportFilename string)

添加测试报告

func (*APITestPlan) Delete

func (this *APITestPlan) Delete() error

删除当前测试计划

func (*APITestPlan) LastReport

func (this *APITestPlan) LastReport() *APITestPlanReport

读取最后一次报告

func (*APITestPlan) MatchTime

func (this *APITestPlan) MatchTime(currentTime time.Time) bool

检查时间是否匹配

func (*APITestPlan) Save

func (this *APITestPlan) Save() error

保存当前测试计划

func (*APITestPlan) WeekdayNames

func (this *APITestPlan) WeekdayNames() []string

取得周内日期

type APITestPlanReport

type APITestPlanReport struct {
	Filename     string           `yaml:"filename" json:"filename"`         // 文件名
	StartedAt    int64            `yaml:"startedAt" json:"startedAt"`       // 开始时间
	FinishedAt   int64            `yaml:"finishedAt" json:"finishedAt"`     // 结束时间
	TotalAPIs    int              `yaml:"totalApis" json:"totalApis"`       // 总体API数量
	TotalScripts int              `yaml:"totalScripts" json:"totalScripts"` // 总体脚本总数
	Results      []*APITestResult `yaml:"results" json:"results"`           // 统计
	// contains filtered or unexported fields
}

API测试报告

func NewAPITestPlanReport

func NewAPITestPlanReport() *APITestPlanReport

获取新对象

func NewAPITestPlanReportFromFile

func NewAPITestPlanReportFromFile(filename string) *APITestPlanReport

从配置文件中加载测试报告

func (*APITestPlanReport) AddAPIResult

func (this *APITestPlanReport) AddAPIResult(apiResult *APITestResult)

添加API执行结果

func (*APITestPlanReport) CountFailedResults

func (this *APITestPlanReport) CountFailedResults() int

计算失败的结果数

func (*APITestPlanReport) CountResults

func (this *APITestPlanReport) CountResults() int

计算总结果数

func (*APITestPlanReport) CountScripts

func (this *APITestPlanReport) CountScripts() int

计算脚本数

func (*APITestPlanReport) InitFile

func (this *APITestPlanReport) InitFile()

初始化文件信息

func (*APITestPlanReport) Save

func (this *APITestPlanReport) Save() error

保存

func (*APITestPlanReport) Summary

func (this *APITestPlanReport) Summary() maps.Map

取得报告的综合信息

type APITestResult

type APITestResult struct {
	API      string                 `yaml:"api" json:"api"`           // API
	Scripts  []*APITestScriptResult `yaml:"scripts" json:"scripts"`   // 脚本
	IsPassed bool                   `yaml:"isPassed" json:"isPassed"` // 是否通过测试
}

单个API测试结果

func NewAPITestResult

func NewAPITestResult() *APITestResult

获取新对象

func (*APITestResult) AddScriptResult

func (this *APITestResult) AddScriptResult(scriptResult *APITestScriptResult)

添加脚本执行结果

type APITestScriptResult

type APITestScriptResult struct {
	Code     string   `yaml:"code" json:"code"`         // 脚本代码
	IsPassed bool     `yaml:"isPassed" json:"isPassed"` // 是否通过测试
	Failures []string `yaml:"failures" json:"failures"` // 失败
}

单个脚本测试结果

func NewAPITestScriptResult

func NewAPITestScriptResult() *APITestScriptResult

获取新对象

type APIVersion

type APIVersion struct {
	Name string `yaml:"name" json:"name"`
	Code string `yaml:"code" json:"code"`
	On   bool   `yaml:"on" json:"on"`
}

API版本定义

type ApiWatching

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

API监控管理

func NewApiWatching

func NewApiWatching() *ApiWatching

func (*ApiWatching) Add

func (this *ApiWatching) Add(path string)

func (*ApiWatching) Contains

func (this *ApiWatching) Contains(path string) bool

func (*ApiWatching) Remove

func (this *ApiWatching) Remove(path string)

Jump to

Keyboard shortcuts

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