endpoints

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: AGPL-3.0 Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package endpoints 定义所有的 route handle.

Index

Constants

View Source
const (
	ApiTest            = "API_TEST"
	PipelineYmlVersion = "1.1"
	ApiTestType        = "api-test"
	ApiTestIDs         = "api_ids"
	UsecaseID          = "usecase_id"
	PipelineStageLen   = 10
	Project            = "project"
	Usecase            = "case"
)

API 返回对应的错误类型

Variables

This section is empty.

Functions

func InternalReverseHandler

func InternalReverseHandler(handler func(context.Context, *http.Request, map[string]string) error) http.Handler

func NotImplemented

func NotImplemented(ctx context.Context, request *http.Request, m map[string]string) (httpserver.Responser, error)

func ProxyMetrics

func ProxyMetrics(ctx context.Context, r *http.Request, vars map[string]string) error

Types

type Endpoints

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

Endpoints 定义 endpoint 方法

func New

func New(options ...Option) *Endpoints

func (*Endpoints) APIDocWebsocket

func (e *Endpoints) APIDocWebsocket(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*Endpoints) CreateAPIAsset

func (e *Endpoints) CreateAPIAsset(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

CreateAPIAsset creates APIAsset

func (*Endpoints) CreateAPIVersion

func (e *Endpoints) CreateAPIVersion(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

CreateAPIVersion 创建 API 资料版本

func (*Endpoints) CreateAccess

func (e *Endpoints) CreateAccess(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

CreateAccess creates an Access

func (*Endpoints) CreateClient

func (e *Endpoints) CreateClient(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

创建一个客户端

func (*Endpoints) CreateContract

func (e *Endpoints) CreateContract(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

创建一个合约

func (*Endpoints) CreateInstantiation

func (e *Endpoints) CreateInstantiation(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

实例化 (即创建一个 instantiation)

func (*Endpoints) CreateNode

func (e *Endpoints) CreateNode(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) CreateSLA

func (e *Endpoints) CreateSLA(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

创建 SLA

func (*Endpoints) DeleteAPIAsset

func (e *Endpoints) DeleteAPIAsset(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

DeleteAPIAsset deletes APIAsset

func (*Endpoints) DeleteAPIAssetVersion

func (e *Endpoints) DeleteAPIAssetVersion(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

DeleteAPIAssetVersion 删除 API Version

func (*Endpoints) DeleteAccess

func (e *Endpoints) DeleteAccess(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) DeleteClient

func (e *Endpoints) DeleteClient(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) DeleteContract

func (e *Endpoints) DeleteContract(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) DeleteNode

func (e *Endpoints) DeleteNode(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) DeleteSLA

func (e *Endpoints) DeleteSLA(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) DownloadSpecText

func (e *Endpoints) DownloadSpecText(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) (err error)

下载 swagger 文本

func (*Endpoints) ExecuteAttemptTest

func (e *Endpoints) ExecuteAttemptTest(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) GetAPIAsset

func (e *Endpoints) GetAPIAsset(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

GetAPIAsset selects APIAsset

func (*Endpoints) GetAPIAssetVersion

func (e *Endpoints) GetAPIAssetVersion(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

GetAPIAssetVersion 查询 API 资产版本详情

func (*Endpoints) GetAccess

func (e *Endpoints) GetAccess(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) GetClient

func (e *Endpoints) GetClient(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

查询一个客户端的详情

func (*Endpoints) GetContract

func (e *Endpoints) GetContract(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) GetInstantiations

func (e *Endpoints) GetInstantiations(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

查询 minor 下的 instantiation

func (*Endpoints) GetNodeDetail

func (e *Endpoints) GetNodeDetail(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) GetOperation

func (e *Endpoints) GetOperation(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

查询文档中的接口详情

func (*Endpoints) GetSLA

func (e *Endpoints) GetSLA(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) Health

func (e *Endpoints) Health(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

Health 健康检查

func (*Endpoints) ListAPIGateways

func (e *Endpoints) ListAPIGateways(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ListAccess

func (e *Endpoints) ListAccess(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

ListAccess lists Accesses

func (*Endpoints) ListChildrenNodes

func (e *Endpoints) ListChildrenNodes(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ListContract

func (e *Endpoints) ListContract(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

查询客户端下的合约列表

func (*Endpoints) ListContractRecords

func (e *Endpoints) ListContractRecords(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

查询合约操作记录

func (*Endpoints) ListMyClients

func (e *Endpoints) ListMyClients(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

获取本人创建的客户端列表

func (*Endpoints) ListProjectAPIGateways

func (e *Endpoints) ListProjectAPIGateways(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ListRuntimeServices

func (e *Endpoints) ListRuntimeServices(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

拉取 application 下的服务的地址

func (*Endpoints) ListSLAs

func (e *Endpoints) ListSLAs(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

SLAs 列表

func (*Endpoints) ListSwaggerClient

func (e *Endpoints) ListSwaggerClient(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ListSwaggerVersions

func (e *Endpoints) ListSwaggerVersions(ctx context.Context, r *http.Request,
	vars map[string]string) (httpserver.Responser, error)

查询 swaggerVersions (即版本树)

func (*Endpoints) MvCpNode

func (e *Endpoints) MvCpNode(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) PagingAPIAssetVersions

func (e *Endpoints) PagingAPIAssetVersions(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

PagingAPIAssetVersions 查询 API 资料版本列表

func (*Endpoints) PagingAPIAssets

func (e *Endpoints) PagingAPIAssets(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

PagingAPIAssets pages APIAssets

func (*Endpoints) Routes

func (e *Endpoints) Routes() []httpserver.Endpoint

Routes 返回 endpoints 的所有 endpoint 方法,也就是 route.

func (*Endpoints) SearchOperations

func (e *Endpoints) SearchOperations(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

从文档中搜索符合条件的接口列表

func (*Endpoints) UpdateAPIAsset

func (e *Endpoints) UpdateAPIAsset(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

UpdateAPIAsset updates APIAsset

func (*Endpoints) UpdateAccess

func (e *Endpoints) UpdateAccess(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) UpdateAssetVersion

func (e *Endpoints) UpdateAssetVersion(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

修改版本 (标记为不建议使用)

func (*Endpoints) UpdateClient

func (e *Endpoints) UpdateClient(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) UpdateContract

func (e *Endpoints) UpdateContract(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

更新合约状态

func (*Endpoints) UpdateInstantiation

func (e *Endpoints) UpdateInstantiation(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

修改实例

func (*Endpoints) UpdateNode

func (e *Endpoints) UpdateNode(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) UpdateSLA

func (e *Endpoints) UpdateSLA(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ValidateSwagger

func (e *Endpoints) ValidateSwagger(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

type Option

type Option func(*Endpoints)

func WithAssetSvc

func WithAssetSvc(svc *assetsvc.Service) Option

func WithFileTreeSvc

func WithFileTreeSvc(svc *apidocsvc.Service) Option

func WithQueryStringDecoder

func WithQueryStringDecoder(decoder *schema.Decoder) Option

Jump to

Keyboard shortcuts

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