dto

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RT_AUTO_REGISTER = "register"
	RT_AUTO          = "auto"
	RT_MANUAL        = "manual"
	NT_IN            = "inner"
	NT_OUT           = "outer"
	ST_UP            = "asc"
	ST_DOWN          = "desc"
)
View Source
const (
	CT_PRO = "project"
	CT_ORG = "org"
)
View Source
const (
	RT_SERVICE = "service"
	RT_URL     = "url"
)

RedirectType

View Source
const (
	AT_KEY_AUTH   = "key-auth"
	AT_OAUTH2     = "oauth2"
	AT_SIGN_AUTH  = "sign-auth"
	AT_HMAC_AUTH  = "hmac-auth"
	AT_ALIYUN_APP = "aliyun-app"
)

AuthType

View Source
const (
	ACL      = "acl"
	ACL_NONE = ""
	ACL_ON   = "on"
	ACL_OFF  = "off"
)

AclType

View Source
const (
	OPENAPI_SCENE = "openapi"
	WEBAPI_SCENE  = "webapi"
	UNITY_SCENE   = "unity"
)

Scene

View Source
const (
	EDT_CUSTOM  = "CUSTOM"
	EDT_DEFAULT = "DEFAULT"
)
View Source
const (
	UI_NORMAL = "normal"
	UI_K8S    = "k8s"
)
View Source
const (
	BASE_PRIORITY                 = 0
	WILDCARD_DOMAIN_BASE_PRIORITY = 1000
)

Variables

View Source
var HMACAUTH_CONFIG map[string]interface{}
View Source
var INNER_HOSTS = []string{
	"dev-api-gateway.kube-system.svc.cluster.local",
	"test-api-gateway.kube-system.svc.cluster.local",
	"staging-api-gateway.kube-system.svc.cluster.local",
	"api-gateway.kube-system.svc.cluster.local",
}
View Source
var KEYAUTH_CONFIG map[string]interface{}
View Source
var OAUTH2_CONFIG map[string]interface{}
View Source
var RULE_PRIORITY = map[RuleCategory]int{
	AUTH_RULE:  1000,
	ACL_RULE:   999,
	LIMIT_RULE: 998,
}
View Source
var SIGNAUTH_CONFIG map[string]interface{}

Functions

func MakePolicies added in v1.3.0

func MakePolicies(dtos []PolicyDto) (res []*pb.Policy)

Types

type AliyunAppCredential

type AliyunAppCredential struct {
	AppKey    string `json:"appKey"`
	AppSecret string `json:"appSecret"`
}

type ApiAuthData

type ApiAuthData struct {
	Access bool `json:"access"`
}

type ApiAuthErr

type ApiAuthErr struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
}

type ApiAuthReqDto

type ApiAuthReqDto struct {
	UserID   string `json:"userID"`
	Scope    string `json:"scope"`
	ScopeID  int    `json:"scopeID"`
	Resource string `json:"resource"`
	Action   string `json:"action"`
}

type ApiAuthRespDto

type ApiAuthRespDto struct {
	Success bool        `json:"success"`
	Data    ApiAuthData `json:"data"`
	Err     ApiAuthErr  `json:"err"`
}

func (ApiAuthRespDto) HasPermission

func (dto ApiAuthRespDto) HasPermission() bool

type ApiCreateRespDto

type ApiCreateRespDto struct {
	ApiId string `json:"apiId"`
}

type ApiDto

type ApiDto struct {
	// 路径
	Path string `json:"path"`
	// 方法
	Method string `json:"method"`
	// 转发方式
	RedirectType string `json:"redirectType"`
	// 转发地址
	RedirectAddr string `json:"redirectAddr"`
	// 转发地址
	RedirectPath string `json:"redirectPath"`
	// 域名
	Hosts []string `json:"hosts"`
	//项目名称
	ProjectId string `json:"projectId"`
	// 描述
	Description string `json:"description"`
	// 应用名
	DiceApp string `json:"diceApp"`
	// 服务名
	DiceService string `json:"diceService"`
	// 是否开启公网访问
	OuterNetEnable bool `json:"outerNetEnable"`
	// 分支id
	RuntimeId string `json:"runtimeId"`
	//环境
	Env              string      `json:"env"`
	RegisterType     string      `json:"-"`
	NeedAuth         int         `json:"-"`
	UpstreamApiId    string      `json:"-"`
	RuntimeServiceId string      `json:"-"`
	IsInner          int         `json:"-"`
	Swagger          interface{} `json:"-"`
	DaoId            string      `json:"-"`
}

func MakeApiDto added in v1.3.0

func MakeApiDto(req *pb.ApiRequest) *ApiDto

type ApiInfoDto

type ApiInfoDto struct {
	ApiId string `json:"apiId"`
	// 列表中展示时使用此字段
	Path string `json:"path"`
	// API编辑时用于展现
	DisplayPath string `json:"displayPath"`
	// 若有此字段,API编辑时展现前缀
	DisplayPathPrefix string      `json:"displayPathPrefix,omitempty"`
	OuterNetEnable    bool        `json:"outerNetEnable"`
	RegisterType      string      `json:"registerType"`
	NeedAuth          bool        `json:"needAuth"`
	Method            string      `json:"method,omitempty"`
	Description       string      `json:"description"`
	RedirectAddr      string      `json:"redirectAddr"`
	RedirectPath      string      `json:"redirectPath"`
	RedirectType      string      `json:"redirectType"`
	MonitorPath       string      `json:"monitorPath"`
	Group             GroupDto    `json:"group"`
	CreateAt          string      `json:"createAt"`
	Policies          []PolicyDto `json:"policies"`
	Swagger           interface{} `json:"swagger,omitempty"`
}

type ApiPrefixReqDto

type ApiPrefixReqDto struct {
	OrgId     string
	ProjectId string
	Env       string
	App       string
	Service   string
	RuntimeId string
}

type ApiReqDto

type ApiReqDto struct {
	*ApiDto
	*ApiReqOptionDto
}

func (*ApiReqDto) AddHost

func (dto *ApiReqDto) AddHost(host string)

func (*ApiReqDto) IsEmpty

func (dto *ApiReqDto) IsEmpty() bool

type ApiReqOptionDto

type ApiReqOptionDto struct {
	// 插件信息
	Policies []string `json:"policies"`
	// consumerId
	ConsumerId string `json:"consumerId"`
}

type BindDomainDto

type BindDomainDto struct {
	DomainPrefix string `json:"domainPrefix,omitempty"`
	DomainSuffix string `json:"domainSuffix"`
}

type CallMockDto

type CallMockDto struct {
	HeadKey string `json:"headKey"`
	PathUrl string `json:"pathUrl"`
	Method  string `json:"method"`
}

type CategoryInfoDto

type CategoryInfoDto struct {
	Category    string      `json:"category"`
	Description string      `json:"description"`
	PolicyList  []PolicyDto `json:"policyList"`
}

type ClientInfoDto

type ClientInfoDto struct {
	ClientId     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

type CloudapiBindInfo

type CloudapiBindInfo struct {
	Domain string `json:"domain"`
}

type CloudapiGroupInfo

type CloudapiGroupInfo struct {
	GroupId string
	Domain  string
}

type CloudapiInfo

type CloudapiInfo struct {
	CloudapiExists bool `json:"cloudapiExists"`
}

type ConsumerAclInfoDto

type ConsumerAclInfoDto struct {
	PackageInfoDto
	Selected bool `json:"selected"`
}

func (ConsumerAclInfoDto) ToAcl added in v1.3.0

func (dto ConsumerAclInfoDto) ToAcl() *pb.Acl

type ConsumerAclsDto

type ConsumerAclsDto struct {
	Packages []string `json:"packages"`
}

type ConsumerAllResp

type ConsumerAllResp struct {
	Consumers []ConsumerInfoDto `json:"consumers"`
}

type ConsumerApiDto

type ConsumerApiDto struct {
	ConsumerApiId string   `json:"consumerApiId"`
	Policies      []string `json:"policies"`
}

type ConsumerApiInfoDto

type ConsumerApiInfoDto struct {
	Id              string                   `json:"id"`
	ConsumerId      string                   `json:"consumerId"`
	ApiId           string                   `json:"apiId"`
	ApiPath         string                   `json:"apiPath"`
	Method          string                   `json:"method"`
	RedirectAddr    string                   `json:"redirectAddr"`
	Description     string                   `json:"description"`
	RateLimitPolicy ConsumerApiPolicyInfoDto `json:"rateLimitPolicy"`
}

type ConsumerApiPolicyInfoDto

type ConsumerApiPolicyInfoDto struct {
	PolicyId    string `json:"policyId"`
	PolicyName  string `json:"policyName"`
	DisplayName string `json:"displayName"`
	Category    string `json:"category"`
	Description string `json:"description"`
	Config      string `json:"config"`
}

type ConsumerApiReqDto

type ConsumerApiReqDto struct {
	List []ConsumerApiDto `json:"list"`
}

type ConsumerCreateDto

type ConsumerCreateDto struct {
	OrgId        int    `json:"orgId"`
	ProjectId    string `json:"projectId"`
	Env          string `json:"env"`
	ConsumerId   string `json:"consumerId"`
	ConsumerName string `json:"consumerName"`
	Description  string `json:"description"`
}

func NewConsumerCreateDto

func NewConsumerCreateDto() *ConsumerCreateDto

func (ConsumerCreateDto) IsEmpty

func (dto ConsumerCreateDto) IsEmpty() bool

type ConsumerCredentialsDto

type ConsumerCredentialsDto struct {
	ConsumerName string                  `json:"consumerName"`
	ConsumerId   string                  `json:"consumerId"`
	AuthConfig   *orm.ConsumerAuthConfig `json:"authConfig"`
}

func FromCredentials added in v1.3.0

func FromCredentials(creds *pb.ConsumerCredentials) *ConsumerCredentialsDto

func (ConsumerCredentialsDto) ToCredentials added in v1.3.0

func (dto ConsumerCredentialsDto) ToCredentials() *pb.ConsumerCredentials

type ConsumerDto

type ConsumerDto struct {
	ConsumerCredentialsDto
	Endpoint        EndPoint `json:"endpoint"`
	GatewayInstance string   `json:"gatewayInstance"`
	ClusterName     string   `json:"clusterName"`
}

type ConsumerEditDto

type ConsumerEditDto struct {
	ConsumerId string   `json:"consumerId"`
	ApiList    []string `json:"apiList"`
}

type ConsumerEditRespDto

type ConsumerEditRespDto struct {
	ConsumerApis map[string]string `json:"consumerApis"`
}

type ConsumerInfoDto

type ConsumerInfoDto struct {
	ConsumerId       string               `json:"consumerId"`
	ConsumerName     string               `json:"consumerName"`
	ConsumerApiInfos []ConsumerApiInfoDto `json:"consumerApiInfos"`
}

type CreateConsumerResp

type CreateConsumerResp struct {
	ConsumerId   string                  `json:"consumerId"`
	ConsumerName string                  `json:"consumerName"`
	AuthConfig   *orm.ConsumerAuthConfig `json:"authConfig"`
}

type DiceApiInfoDto

type DiceApiInfoDto struct {
	ApiId       string `json:"apiId"`
	ApiPath     string `json:"apiPath"`
	Method      string `json:"method"`
	Selected    bool   `json:"selected"`
	Description string `json:"description"`
}

type DiceApiLoadInfoDto

type DiceApiLoadInfoDto struct {
	RoutePrefix string           `json:"routePrefix"`
	Apis        []DiceApiInfoDto `json:"apis"`
}

type DiceArgsDto

type DiceArgsDto struct {
	OrgId       string
	ProjectId   string
	Env         string
	DiceApp     string
	DiceService string
	PageNo      int64
	PageSize    int64
	SortField   string
	SortType    string
}

func NewDiceArgsDto

func NewDiceArgsDto(c *gin.Context) DiceArgsDto

func (DiceArgsDto) GenSelectOptions

func (impl DiceArgsDto) GenSelectOptions() []orm.SelectOption

type DiceHealthDto

type DiceHealthDto struct {
	Status  DiceHealthStatus   `json:"status"`
	Modules []DiceHealthModule `json:"modules"`
}

type DiceHealthModule

type DiceHealthModule struct {
	Name    string           `json:"name"`
	Status  DiceHealthStatus `json:"status"`
	Message string           `json:"message"`
}

type DiceHealthStatus

type DiceHealthStatus string
const (
	DiceHealthOK   DiceHealthStatus = "ok"
	DiceHealthFail DiceHealthStatus = "fail"
)

type DiceInfo added in v1.3.0

type DiceInfo struct {
	OrgId       string
	ProjectId   string
	Env         string
	Az          string
	AppName     string
	ServiceName string
}

type DomainLinkInfo

type DomainLinkInfo struct {
	ProjectID   string `json:"projectID"`
	AppID       string `json:"appID"`
	RuntimeID   string `json:"runtimeID"`
	ServiceName string `json:"serviceName"`
	Workspace   string `json:"workspace"`
	TenantGroup string `json:"tenantGroup"`
}

type DomainType

type DomainType string
const (
	ServiceDomain DomainType = "service"
	GatewayDomain DomainType = "gateway"
	OtherDomain   DomainType = "other"
)

type EndPoint

type EndPoint struct {
	OuterAddr string `json:"outerAddr"`
	InnerAddr string `json:"innerAddr"`
	InnerTips string `json:"innerTips"`
}

type EndpointDomainDto

type EndpointDomainDto struct {
	Domain string `json:"domain"`
	Type   string `json:"type"`
}

func (EndpointDomainDto) CheckValid

func (dto EndpointDomainDto) CheckValid() error

type GatewayGroupInfo

type GatewayGroupInfo struct {
	GatewayGroup orm.GatewayGroup    `json:"gatewayGroup"`
	Policies     []orm.GatewayPolicy `json:"policies"`
}

func (*GatewayGroupInfo) AddPolicy

func (dto *GatewayGroupInfo) AddPolicy(policy *orm.GatewayPolicy)

type GetApisDto

type GetApisDto struct {
	From             string
	Method           string
	ConsumerId       string
	RuntimeId        string
	RuntimeServiceId string
	DiceApp          string
	DiceService      string
	ApiPath          string
	RegisterType     string
	NetType          string
	NeedAuth         int
	SortField        string
	SortType         string
	OrgId            string
	ProjectId        string
	Env              string
	Size             int64
	Page             int64
}

type GetDiceApiDto

type GetDiceApiDto struct {
	DiceArgsDto
	ApiPath string
	Method  string
}

func NewGetDiceApiDto

func NewGetDiceApiDto(c *gin.Context) GetDiceApiDto

func (GetDiceApiDto) GenSelectOptions

func (impl GetDiceApiDto) GenSelectOptions() []orm.SelectOption

type GetOpenConsumersDto

type GetOpenConsumersDto struct {
	DiceArgsDto
}

func (GetOpenConsumersDto) GenSelectOptions

func (impl GetOpenConsumersDto) GenSelectOptions() []orm.SelectOption

type GetOpenLimitRulesDto

type GetOpenLimitRulesDto struct {
	DiceArgsDto
	ConsumerId string
	PackageId  string
}

func NewGetOpenLimitRulesDto

func NewGetOpenLimitRulesDto(c *gin.Context) GetOpenLimitRulesDto

func (GetOpenLimitRulesDto) GenSelectOptions

func (impl GetOpenLimitRulesDto) GenSelectOptions() []orm.SelectOption

type GetOpenapiDto

type GetOpenapiDto struct {
	DiceArgsDto
	ApiPath string
	Method  string
	Origin  string
}

func NewGetOpenapiDto

func NewGetOpenapiDto(c *gin.Context) GetOpenapiDto

func (GetOpenapiDto) GenSelectOptions

func (impl GetOpenapiDto) GenSelectOptions() []orm.SelectOption

type GetPackagesDto

type GetPackagesDto struct {
	DiceArgsDto
	Domain string
}

type GroupCreateDto

type GroupCreateDto struct {
	ProjectId   string   `json:"projectId"`
	OrgId       string   `json:"orgId"`
	GroupName   string   `json:"groupName"`
	DisplayName string   `json:"display_Name"`
	GroupId     string   `json:"groupId"`
	Policies    []string `json:"policies"`
	Env         string   `json:"env"`
}

type GroupCreateRes

type GroupCreateRes struct {
}

type GroupDto

type GroupDto struct {
	GroupId     string `json:"groupId"`
	GroupName   string `json:"groupName"`
	DisplayName string `json:"displayName"`
}

type GwApiGroupDto

type GwApiGroupDto struct {
	GroupId     string           `json:"groupId"`
	GroupName   string           `json:"groupName"`
	DisplayName string           `json:"displayName"`
	CreateAt    string           `json:"createAt"`
	Policies    []GwApiPolicyDto `json:"policies"`
}

func (*GwApiGroupDto) AddPolicy

func (dto *GwApiGroupDto) AddPolicy(policy *GwApiPolicyDto)

AddPolicy

type GwApiPolicyDto

type GwApiPolicyDto struct {
	Category    string `json:"category"`
	PolicyId    string `json:"policyId"`
	DisplayName string `json:"displayName"`
}

type LoadDiceApiDto

type LoadDiceApiDto struct {
	DiceApp     string   `json:"diceApp"`
	DiceService string   `json:"diceService"`
	RoutePrefix string   `json:"routePrefix"`
	Apis        []string `json:"apis"`
}

type ManageDomainInfo

type ManageDomainInfo struct {
	ID          string          `json:"id"`
	Domain      string          `json:"domain"`
	ClusterName string          `json:"clusterName"`
	Type        DomainType      `json:"type"`
	ProjectName string          `json:"projectName"`
	AppName     string          `json:"appName"`
	Workspace   string          `json:"workspace"`
	Link        *DomainLinkInfo `json:"link,omitempty"`
}

type ManageDomainReq

type ManageDomainReq struct {
	OrgId       string
	Domain      string
	ClusterName string
	Type        DomainType
	ProjectID   string
	Workspace   string
	PageSize    int64
	PageNo      int64
}

func (ManageDomainReq) GenSelectOptions

func (req ManageDomainReq) GenSelectOptions() []orm.SelectOption

type MockInfoDto

type MockInfoDto struct {
	Az      string `json:"az"`
	HeadKey string `json:"headKey"`
	Body    string `json:"body"`
	PathUrl string `json:"pathUrl"`
	Method  string `json:"method"`
}

type OpenConsumerDto

type OpenConsumerDto struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"-"`
}

type OpenConsumerInfoDto

type OpenConsumerInfoDto struct {
	Id       string `json:"id"`
	CreateAt string `json:"createAt"`
	OpenConsumerDto
}

func (OpenConsumerInfoDto) ToConsumer added in v1.3.0

func (dto OpenConsumerInfoDto) ToConsumer() *pb.Consumer

type OpenLimitRuleDto

type OpenLimitRuleDto struct {
	ConsumerId string                 `json:"consumerId"`
	PackageId  string                 `json:"packageId"`
	Method     string                 `json:"method"`
	ApiPath    string                 `json:"apiPath"`
	Limit      exdto.LimitType        `json:"limit"`
	KongConfig map[string]interface{} `json:"-"`
	ApiId      string                 `json:"-"`
}

func FromLimitRequest added in v1.3.0

func FromLimitRequest(limit *pb.LimitRequest) *OpenLimitRuleDto

func (OpenLimitRuleDto) ToLimitRequest added in v1.3.0

func (dto OpenLimitRuleDto) ToLimitRequest() *pb.LimitRequest

type OpenLimitRuleInfoDto

type OpenLimitRuleInfoDto struct {
	OpenLimitRuleDto
	Id           string `json:"id"`
	CreateAt     string `json:"createAt"`
	ConsumerName string `json:"consumerName"`
	PackageName  string `json:"packageName"`
}

type OpenapiDto

type OpenapiDto struct {
	ApiPath             string `json:"apiPath"`
	RedirectType        string `json:"redirectType"`
	RedirectAddr        string `json:"redirectAddr"`
	RedirectPath        string `json:"redirectPath"`
	RedirectApp         string `json:"redirectApp"`
	RedirectService     string `json:"redirectService"`
	RedirectRuntimeId   string `json:"redirectRuntimeId"`
	RedirectRuntimeName string `json:"redirectRuntimeName"`
	Method              string `json:"method,omitempty"`
	AllowPassAuth       bool   `json:"allowPassAuth"`
	//	AclType            string   `json:"aclType"`
	Description        string   `json:"description"`
	Origin             Origin   `json:"-"`
	AdjustPath         string   `json:"-"`
	AdjustRedirectAddr string   `json:"-"`
	ServiceRewritePath string   `json:"-"`
	IsRegexPath        bool     `json:"-"`
	RouteId            string   `json:"-"`
	ServiceId          string   `json:"-"`
	ZoneId             string   `json:"-"`
	ProjectId          string   `json:"-"`
	Env                string   `json:"-"`
	RuntimeServiceId   string   `json:"-"`
	Hosts              []string `json:"hosts"`
}

func FromEndpointApi added in v1.3.0

func FromEndpointApi(ep *pb.EndpointApi) *OpenapiDto

func (*OpenapiDto) Adjust

func (dto *OpenapiDto) Adjust() error

func (*OpenapiDto) CheckValid

func (dto *OpenapiDto) CheckValid() (bool, string)

func (OpenapiDto) ToEndpointApi added in v1.3.0

func (dto OpenapiDto) ToEndpointApi() *pb.EndpointApi

type OpenapiInfoDto

type OpenapiInfoDto struct {
	ApiId       string `json:"apiId"`
	CreateAt    string `json:"createAt"`
	DiceApp     string `json:"diceApp"`
	DiceService string `json:"diceService"`
	Origin      Origin `json:"origin"`
	Mutable     bool   `json:"mutable"`
	OpenapiDto
}

func (OpenapiInfoDto) ToEndpointApi added in v1.3.0

func (dto OpenapiInfoDto) ToEndpointApi() *pb.EndpointApi

type OpenapiRule

type OpenapiRule struct {
	Region          RuleRegion
	PackageApiId    string
	PackageId       string
	PluginId        string
	PluginName      string
	Category        RuleCategory
	Config          map[string]interface{}
	Enabled         bool
	PackageZoneNeed bool
	NotKongPlugin   bool
	ConsumerId      string
}

type OpenapiRuleInfo

type OpenapiRuleInfo struct {
	Id string
	OpenapiRule
}

type Origin

type Origin string
const (
	FROM_DICE    Origin = "dice"
	FROM_CUSTOM  Origin = "custom"
	FROM_DICEYML Origin = "diceyml"
	FROM_SHADOW  Origin = "shadow"
)

type PackageAclInfoDto

type PackageAclInfoDto struct {
	OpenConsumerInfoDto
	Selected bool `json:"selected"`
}

func (PackageAclInfoDto) ToAcl added in v1.3.0

func (dto PackageAclInfoDto) ToAcl() *pb.Acl

type PackageAclsDto

type PackageAclsDto struct {
	Consumers []string `json:"consumers"`
}

type PackageDto

type PackageDto struct {
	Name             string   `json:"name"`
	BindDomain       []string `json:"bindDomain"`
	AuthType         string   `json:"authType"`
	AclType          string   `json:"aclType"`
	Scene            string   `json:"scene"`
	Description      string   `json:"description"`
	NeedBindCloudapi bool     `json:"needBindCloudapi"`
}

func FromEndpoint added in v1.3.0

func FromEndpoint(ep *pb.Endpoint) *PackageDto

func (PackageDto) CheckValid

func (dto PackageDto) CheckValid() error

type PackageInfoDto

type PackageInfoDto struct {
	Id       string `json:"id"`
	CreateAt string `json:"createAt"`
	PackageDto
}

func (PackageInfoDto) ToEndpoint added in v1.3.0

func (dto PackageInfoDto) ToEndpoint() *pb.Endpoint

type PathVariableConfig

type PathVariableConfig struct {
	RequestRegex string `json:"request_regex"`
	RewritePath  string `json:"rewrite_path"`
	Carrier      string `json:"CARRIER"`
}

type PluginDto

type PluginDto struct {
	Category   string         `json:"category"`
	SubPlugins []SubPluginDto `json:"subPlugins"`
}

type PolicyCreateDto

type PolicyCreateDto struct {
	OrgId       int                    `json:"orgId"`
	ProjectId   string                 `json:"projectId"`
	PolicyName  string                 `json:"policyName"`
	DisplayName string                 `json:"displayName"`
	Config      map[string]interface{} `json:"config"`
	Env         string                 `json:"env"`
}

func (PolicyCreateDto) IsEmpty

func (dto PolicyCreateDto) IsEmpty() bool

type PolicyCreateRespDto

type PolicyCreateRespDto struct {
	PolicyId string `json:"policyId"`
}

type PolicyDto

type PolicyDto struct {
	Category    string                 `json:"category"`
	PolicyId    string                 `json:"policyId"`
	PolicyName  string                 `json:"policyName"`
	DisplayName string                 `json:"displayName"`
	Config      map[string]interface{} `json:"config"`
	CreateAt    string                 `json:"createAt"`
}

type PublishAuthNDto

type PublishAuthNDto struct {
	Type   string                 `json:"type"`
	Config map[string]interface{} `json:"config"`
}

type PublishDto

type PublishDto struct {
	OwnerEmail        string `json:"ownerEmail"`
	ItemName          string `json:"itemName"`
	OrgId             string `json:"orgId"`
	DicePublishItemId string `json:"-"`
	DicePublishId     string `json:"-"`
}

type RegisterApp

type RegisterApp struct {
	Name     string   `json:"name"`
	Services []string `json:"services"`
}

type RegisterAppsDto

type RegisterAppsDto struct {
	Apps []RegisterApp `json:"apps"`
}

type RegisterDto

type RegisterDto struct {
	OrgId       string          `json:"orgId"`
	ProjectId   string          `json:"projectId"`
	Workspace   string          `json:"workspace"`
	ClusterName string          `json:"clusterName"`
	AppId       string          `json:"appId"`
	AppName     string          `json:"appName"`
	RuntimeId   string          `json:"runtimeId"`
	RuntimeName string          `json:"runtimeName"`
	ServiceName string          `json:"serviceName"`
	ServiceAddr string          `json:"serviceAddr"`
	Swagger     json.RawMessage `json:"swagger"`
}

func (RegisterDto) CheckValid

func (dto RegisterDto) CheckValid() error

type RegisterRespDto

type RegisterRespDto struct {
	ApiRegisterId string `json:"apiRegisterId"`
}

type RegisterStatusDto

type RegisterStatusDto struct {
	Completed bool `json:"completed"`
}

type RouteInfoConfig

type RouteInfoConfig struct {
	ProjectId string `json:"project_id"`
	Workspace string `json:"workspace"`
	App       string `json:"app"`
	Service   string `json:"service"`
	ApiPath   string `json:"api_path"`
	Carrier   string `json:"CARRIER"`
}

type RuleCategory

type RuleCategory string
const (
	ACL_RULE   RuleCategory = "acl"
	AUTH_RULE  RuleCategory = "auth"
	LIMIT_RULE RuleCategory = "limit"
)

type RuleRegion

type RuleRegion int
const (
	PACKAGE_RULE RuleRegion = iota
	API_RULE
)

type RuntimeDomain

type RuntimeDomain struct {
	AppName      string `json:"appName"`
	Domain       string `json:"domain"`
	DomainType   string `json:"domainType"`
	CustomDomain string `json:"customDomain"`
	RootDomain   string `json:"rootDomain"`
	UseHttps     bool   `json:"useHttps"`
	PackageId    string `json:"packageId,omitempty"`
	TenantGroup  string `json:"tenantGroup,omitempty"`
}

type RuntimeDomainsDto

type RuntimeDomainsDto map[string][]RuntimeDomain

type RuntimeServiceReqDto

type RuntimeServiceReqDto struct {
	OrgId                 string             `json:"orgId"`
	ProjectId             string             `json:"projectID"`
	Env                   string             `json:"env"`
	ClusterName           string             `json:"clusterName"`
	RuntimeId             string             `json:"runtimeID"`
	RuntimeName           string             `json:"runtimeName"`
	ReleaseId             string             `json:"releaseId"`
	ServiceGroupNamespace string             `json:"serviceGroupNamespace"`
	ProjectNamespace      string             `json:"projectNamespace"`
	ServiceGroupName      string             `json:"serviceGroupName"`
	AppId                 string             `json:"appID"`
	AppName               string             `json:"appName"`
	Services              []ServiceDetailDto `json:"services"`
	UseApigw              bool               `json:"useApigw"`
}

func (RuntimeServiceReqDto) CheckValid

func (dto RuntimeServiceReqDto) CheckValid() error

type ServiceDetailDto

type ServiceDetailDto struct {
	ServiceName     string              `json:"serviceName"`
	InnerAddress    string              `json:"innerAddress"`
	EndpointDomains []EndpointDomainDto `json:"endpointDomains"`
}

func (ServiceDetailDto) CheckValid

func (dto ServiceDetailDto) CheckValid() error

type ServiceDomainReqDto

type ServiceDomainReqDto struct {
	ReleaseId string   `json:"releaseId"`
	Domains   []string `json:"domains"`
}

func (ServiceDomainReqDto) CheckValid

func (dto ServiceDomainReqDto) CheckValid() error

type SortByRegexList

type SortByRegexList []ZoneKongPolicies

func (SortByRegexList) Len

func (list SortByRegexList) Len() int

func (SortByRegexList) Less

func (list SortByRegexList) Less(i, j int) bool

func (SortByRegexList) Swap

func (list SortByRegexList) Swap(i, j int)

type SortByRuleList

type SortByRuleList []OpenapiRuleInfo

func (SortByRuleList) Len

func (list SortByRuleList) Len() int

func (SortByRuleList) Less

func (list SortByRuleList) Less(i, j int) bool

func (SortByRuleList) Swap

func (list SortByRuleList) Swap(i, j int)

type SortBySceneList

type SortBySceneList []PackageInfoDto

func (SortBySceneList) Len

func (list SortBySceneList) Len() int

func (SortBySceneList) Less

func (list SortBySceneList) Less(i, j int) bool

func (SortBySceneList) Swap

func (list SortBySceneList) Swap(i, j int)

type SortByTypeList

type SortByTypeList []RuntimeDomain

func (SortByTypeList) Len

func (list SortByTypeList) Len() int

func (SortByTypeList) Less

func (list SortByTypeList) Less(i, j int) bool

func (SortByTypeList) Swap

func (list SortByTypeList) Swap(i, j int)

type SubPluginDto

type SubPluginDto struct {
	PluginName string `json:"pluginName"`
	PolicyId   string `json:"policyId"`
}

type SubscribeDto

type SubscribeDto struct {
	SubscriberEmail string `json:"subscriberEmail"`
	Description     string `json:"description"`
}

func (SubscribeDto) CheckValid

func (dto SubscribeDto) CheckValid() error

type TenantDto

type TenantDto struct {
	Id              string `json:"id"`
	TenantGroup     string `json:"tenantGroup"`
	Az              string `json:"az"`
	Env             string `json:"env"`
	ProjectId       string `json:"projectId"`
	ProjectName     string `json:"projectName"`
	AdminAddr       string `json:"adminAddr"`
	GatewayEndpoint string `json:"gatewayEndpoint"`
	InnerAddr       string `json:"innerAddr"`
	ServiceName     string `json:"serviceName"`
	InstanceId      string `json:"instanceId"`
}

type UITypeDto

type UITypeDto struct {
	UIType string `json:"uiType"`
}

type UpstreamApiDto

type UpstreamApiDto struct {
	Path        string      `json:"path"`
	GatewayPath string      `json:"gatewayPath"`
	Method      string      `json:"method"`
	Address     string      `json:"address"`
	IsInner     bool        `json:"isInner"`
	IsCustom    bool        `json:"isCustom"`
	Doc         interface{} `json:"doc"`
	Name        string      `json:"name"`
}

func FromUpstreamApi added in v1.3.0

func FromUpstreamApi(api *pb.UpstreamApi) UpstreamApiDto

func (*UpstreamApiDto) Init

func (dto *UpstreamApiDto) Init() bool

type UpstreamLbDto

type UpstreamLbDto struct {
	Az              string   `json:"az"`
	LbName          string   `json:"lbName"`
	OrgId           string   `json:"orgId"`
	ProjectId       string   `json:"projectId"`
	Env             string   `json:"env"`
	DeploymentId    int      `json:"deploymentId"`
	HealthcheckPath string   `json:"healthcheckPath"`
	Targets         []string `json:"targets"`
}

func (UpstreamLbDto) IsInvalid

func (dto UpstreamLbDto) IsInvalid() bool

type UpstreamRegisterDto

type UpstreamRegisterDto struct {
	Az            string           `json:"az"`
	UpstreamName  string           `json:"-"`
	DiceAppId     string           `json:"diceAppId"`
	DiceService   string           `json:"diceService"`
	RuntimeName   string           `json:"runtimeName"`
	RuntimeId     string           `json:"runtimeId"`
	AppName       string           `json:"appName"`
	ServiceAlias  string           `json:"serviceName"`
	OrgId         string           `json:"orgId"`
	ProjectId     string           `json:"projectId"`
	Env           string           `json:"env"`
	ApiList       []UpstreamApiDto `json:"apiList"`
	OldRegisterId *int             `json:"registerId"`
	RegisterId    string           `json:"registerTag"`
	PathPrefix    *string          `json:"pathPrefix"`
}

func FromUpstream added in v1.3.0

func FromUpstream(u *pb.Upstream) *UpstreamRegisterDto

func (*UpstreamRegisterDto) Init

func (dto *UpstreamRegisterDto) Init() bool

type ZoneKongPolicies

type ZoneKongPolicies struct {
	Id          string `json:"id"`
	Regex       string `json:"regex"`
	Enables     string `json:"enable"`
	Disables    string `json:"disable"`
	Priority    int    `json:"priority"`
	PackageName string `json:"packageName"`
	ProjectId   string `json:"-"`
	Env         string `json:"-"`
}

Source Files

Jump to

Keyboard shortcuts

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