apigw

package
v0.0.0-...-6ef7557 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package apigw document sync gateway

Package apigw document sync gateway

Index

Constants

View Source
const (
	// Name 网关名
	Name = "bk-bscp"
)

Variables

This section is empty.

Functions

func ReleaseSwagger

func ReleaseSwagger(esbOpt cc.Esb, apiGwOpt cc.ApiGateway, language, version string) error

ReleaseSwagger 导入swagge 文档 nolint:funlen

Types

type Added

type Added struct {
	ID int `json:"id"`
}

Added xxx

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

func NewApiGw

func NewApiGw(esbOpt cc.Esb, apiGwOpt cc.ApiGateway) (ApiGw, error)

NewApiGw 初始化网关

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 Deleted

type Deleted struct {
	ID int `json:"id"`
}

Deleted xxx

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 Host

type Host struct {
	Host   string `json:"host"`
	Weight int    `json:"weight"`
}

Host xx

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 SyncData

type SyncData struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

SyncData xxx

type SyncResourcesData

type SyncResourcesData struct {
	Added   []Added   `json:"added"`
	Updated []Updated `json:"updated"`
	Deleted []Deleted `json:"deleted"`
}

SyncResourcesData xxx

type SyncResourcesReq

type SyncResourcesReq struct {
	Content string `json:"content"`
	Delete  bool   `json:"delete"`
}

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

type TransformHeaders struct {
	Set    map[string]string `json:"set"`
	Delete []string          `json:"delete"`
}

TransformHeaders xxx

type Updated

type Updated struct {
	ID int `json:"id"`
}

Updated xxx

type Upstreams

type Upstreams struct {
	Loadbalance string `json:"loadbalance"`
	Hosts       []Host `json:"hosts"`
}

Upstreams xxx

Jump to

Keyboard shortcuts

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