client

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeepMockClient

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

DeepMockClient Client对象

func NewDeepMockClient

func NewDeepMockClient(url string) *DeepMockClient

NewDeepMockClient client的工厂函数

func (*DeepMockClient) CreateMockRule

func (c *DeepMockClient) CreateMockRule(rule *types.RuleDO) (*types.RuleDO, error)

CreateMockRule 创建规则接口

func (*DeepMockClient) DeleteMockRule

func (c *DeepMockClient) DeleteMockRule(rid string) error

DeleteMockRule 删除规则接口

func (*DeepMockClient) ExportRules

func (c *DeepMockClient) ExportRules() ([]*types.RuleDO, error)

ExportRules 导出所有规则

func (*DeepMockClient) GetMockRule

func (c *DeepMockClient) GetMockRule(rid string) (*types.RuleDO, error)

GetMockRule 获取规则接口

func (*DeepMockClient) ImportRules

func (c *DeepMockClient) ImportRules(rules ...*types.RuleDO) error

ImportRules 导入规则

func (*DeepMockClient) PatchMockRule

func (c *DeepMockClient) PatchMockRule(rule *types.RuleDO) (*types.RuleDO, error)

PatchMockRule 部分更新规则接口

func (*DeepMockClient) PutMockRule

func (c *DeepMockClient) PutMockRule(rule *types.RuleDO) (*types.RuleDO, error)

PutMockRule 全量更新规则接口

type DeepMockError

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

DeepMockError client error结构体

func NewDeepMockError

func NewDeepMockError(res Response) *DeepMockError

NewDeepMockError client error工厂函数

func (*DeepMockError) Error

func (e *DeepMockError) Error() string

Error error的实现

type Response

type Response struct {
	Code         int    `json:"code"`
	ErrorMessage string `json:"err_msg,omitempty"`
}

Response client通用的返回响应

type RuleResponse

type RuleResponse struct {
	Response
	Data *types.RuleDO `json:"data,omitempty"`
}

RuleResponse 单规则接口返回报文

type RulesResponse

type RulesResponse struct {
	Response
	Data []*types.RuleDO `json:"data,omitempty"`
}

RulesResponse 多规则接口返回报文

Jump to

Keyboard shortcuts

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