Documentation ¶
Overview ¶
Package apigw document sync gateway
Package apigw document sync gateway
Index ¶
- Constants
- func ReleaseSwagger(esbOpt cc.Esb, apiGwOpt cc.ApiGateway, language, version string) error
- type Added
- type ApiGw
- type ApplyPermissionData
- type ApplyPermissionsReq
- type ApplyPermissionsResp
- type CreateResourceVersionData
- type CreateResourceVersionReq
- type CreateResourceVersionResp
- type Deleted
- type GetApigwPublicKeyData
- type GetApigwPublicKeyResp
- type GetLatestResourceVersionData
- type GetLatestResourceVersionResp
- type Host
- type ImportResourceDocsBySwaggerReq
- type ImportResourceDocsBySwaggerResp
- type ProxyHttp
- type ReleaseData
- type ReleaseReq
- type ReleaseResp
- type SyncApiReq
- type SyncApiResp
- type SyncData
- type SyncResourcesData
- type SyncResourcesReq
- type SyncResourcesResp
- type SyncStageReq
- type SyncStageResp
- type TransformHeaders
- type Updated
- type Upstreams
Constants ¶
const (
// Name 网关名
Name = "bk-bscp"
)
Variables ¶
This section is empty.
Functions ¶
func ReleaseSwagger ¶
ReleaseSwagger 导入swagge 文档 nolint:funlen
Types ¶
type ApiGw ¶
type ApiGw interface { // SyncApi 同步网关,如果网关不存在,创建网关,如果网关已存在,更新网关 SyncApi(gwName string, req *SyncApiReq) (*SyncApiResp, error) // SyncStage 同步网关环境,如果环境不存在,创建环境,如果已存在,则更新 SyncStage(gwName string, req *SyncStageReq) (*SyncStageResp, error) // SyncResources 同步资源 SyncResources(gwName string, req *SyncResourcesReq) (*SyncResourcesResp, error) // ImportResourceDocsBySwagger 根据 swagger 描述文件,导入资源文档 ImportResourceDocsBySwagger(gwName string, req *ImportResourceDocsBySwaggerReq) ( *ImportResourceDocsBySwaggerResp, error) // CreateResourceVersion 创建资源版本 CreateResourceVersion(gwName string, req *CreateResourceVersionReq) (*CreateResourceVersionResp, error) // GetLatestResourceVersion 获取网关最新的资源版本 GetLatestResourceVersion(gwName string) (*GetLatestResourceVersionResp, error) // Release 发布版本 Release(gwName string, req *ReleaseReq) (*ReleaseResp, error) // ApplyPermissions 申请网关API访问权限 ApplyPermissions(gwName string, req *ApplyPermissionsReq) (*ApplyPermissionsResp, error) // GetApigwPublicKey 获取网关公钥 GetApigwPublicKey(gwName string) (*GetApigwPublicKeyResp, error) }
ApiGw document sync gateway interface
type ApplyPermissionData ¶
type ApplyPermissionData struct {
RecordID int `json:"record_id"`
}
ApplyPermissionData xxx
type ApplyPermissionsReq ¶
type ApplyPermissionsReq struct { TargetAppCode string `json:"target_app_code"` ExpireDays int `json:"expire_days"` GrantDimension string `json:"grant_dimension"` Reason string `json:"reason"` }
ApplyPermissionsReq 输入参数
type ApplyPermissionsResp ¶
type ApplyPermissionsResp struct { Code int `json:"code"` Message string `json:"message"` Data ApplyPermissionData `json:"data"` }
ApplyPermissionsResp 输出参数
type CreateResourceVersionData ¶
type CreateResourceVersionData struct { ID int `json:"id"` Version string `json:"version"` Title string `json:"title"` }
CreateResourceVersionData xxx
type CreateResourceVersionReq ¶
type CreateResourceVersionReq struct { Version string `json:"version"` Title string `json:"title"` Comment string `json:"comment"` }
CreateResourceVersionReq 输入参数
type CreateResourceVersionResp ¶
type CreateResourceVersionResp struct { Code int `json:"code"` Message string `json:"message"` Data CreateResourceVersionData `json:"data"` }
CreateResourceVersionResp 输出参数
type GetApigwPublicKeyData ¶
type GetApigwPublicKeyData struct { Issuer string `json:"issuer"` PublicKey string `json:"public_key"` }
GetApigwPublicKeyData xxx
type GetApigwPublicKeyResp ¶
type GetApigwPublicKeyResp struct { Code int `json:"code"` Message string `json:"message"` Data GetApigwPublicKeyData `json:"data"` }
GetApigwPublicKeyResp 输出参数
type GetLatestResourceVersionData ¶
type GetLatestResourceVersionData struct {
Version string `json:"version"`
}
GetLatestResourceVersionData xxx
type GetLatestResourceVersionResp ¶
type GetLatestResourceVersionResp struct { Code int `json:"code"` Message string `json:"message"` Data GetLatestResourceVersionData `json:"data"` }
GetLatestResourceVersionResp 输出参数
type ImportResourceDocsBySwaggerReq ¶
type ImportResourceDocsBySwaggerReq struct { // Language 文档语言,可选值:zh 表示中文,en 表示英文 Language string `json:"language"` // Swagger 描述文件的内容 Swagger string `json:"swagger"` }
ImportResourceDocsBySwaggerReq 输入参数
type ImportResourceDocsBySwaggerResp ¶
type ImportResourceDocsBySwaggerResp struct { Code int `json:"code"` Data interface{} `json:"data"` Result bool `json:"result"` Message string `json:"message"` }
ImportResourceDocsBySwaggerResp 输出参数
type ProxyHttp ¶
type ProxyHttp struct { Timeout int `json:"timeout"` Upstreams Upstreams `json:"upstreams"` TransformHeaders `json:"transform_headers"` }
ProxyHttp xxx
type ReleaseData ¶
type ReleaseData struct { Version string `json:"version"` StageNames []string `json:"stage_names"` }
ReleaseData xxx
type ReleaseReq ¶
type ReleaseReq struct { Version string `json:"version"` StageNames []string `json:"stage_names"` Comment string `json:"comment"` }
ReleaseReq 输入参数
type ReleaseResp ¶
type ReleaseResp struct { Code int `json:"code"` Message string `json:"message"` Data ReleaseData `json:"data"` }
ReleaseResp 输出参数
type SyncApiReq ¶
type SyncApiReq struct { // Description 网关描述 Description string `json:"description"` // Maintainers 网关管理员 Maintainers []string `json:"maintainers"` // IsPublic 网关是否公开 IsPublic bool `json:"is_public"` }
SyncApiReq 输入参数
type SyncApiResp ¶
type SyncApiResp struct { Data SyncData `json:"data"` Code int `json:"code"` Result bool `json:"result"` Message string `json:"message"` }
SyncApiResp 输出参数
type SyncResourcesData ¶
type SyncResourcesData struct { Added []Added `json:"added"` Updated []Updated `json:"updated"` Deleted []Deleted `json:"deleted"` }
SyncResourcesData xxx
type SyncResourcesReq ¶
SyncResourcesReq 输入参数
type SyncResourcesResp ¶
type SyncResourcesResp struct { Code int `json:"code"` Message string `json:"message"` Data SyncResourcesData `json:"data"` }
SyncResourcesResp 输出参数
type SyncStageReq ¶
type SyncStageReq struct { Name string `json:"name"` Description string `json:"description"` Vars map[string]string `json:"vars"` ProxyHttp ProxyHttp `json:"proxy_http"` }
SyncStageReq 输入参数
type SyncStageResp ¶
type SyncStageResp struct { Data SyncData `json:"data"` Code int `json:"code"` Result bool `json:"result"` Message string `json:"message"` }
SyncStageResp 输出参数
type TransformHeaders ¶
TransformHeaders xxx