Documentation
¶
Index ¶
- type ActiveHealthcheckDto
- type HealthchecksDto
- type HealthyDto
- type KongConfigsDto
- type KongConfiguration
- type KongConsumerReqDto
- type KongConsumerRespDto
- type KongCredentialDto
- type KongCredentialListDto
- type KongCredentialReqDto
- type KongObj
- type KongPluginReqDto
- type KongPluginRespDto
- type KongPluginsDto
- type KongRouteReqDto
- type KongRouteRespDto
- type KongRoutesRespDto
- type KongServiceReqDto
- type KongServiceRespDto
- type KongTargetDto
- type KongUpstreamDto
- type KongUpstreamStatusRespDto
- type PassiveHealthcheckDto
- type Service
- type UnhealthyDto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveHealthcheckDto ¶
type ActiveHealthcheckDto struct { // 默认是1 Timeout int `json:"timeout,omitempty"` // 默认是10 Concurrency int `json:"concurrency,omitempty"` HttpPath string `json:"http_path,omitempty"` Healthy HealthyDto `json:"healthy,omitempty"` Unhealthy UnhealthyDto `json:"unhealthy,omitempty"` }
type HealthchecksDto ¶
type HealthchecksDto struct { Active ActiveHealthcheckDto `json:"active,omitempty"` Passive PassiveHealthcheckDto `json:"passive,omitempty"` }
func NewHealthchecks ¶
func NewHealthchecks(checkPath string) HealthchecksDto
type HealthyDto ¶
type KongConfigsDto ¶
type KongConfigsDto struct { Configuration KongConfiguration `json:"configuration"` Version string `json:"version"` }
type KongConfiguration ¶
type KongConfiguration struct {
Plugins []string `json:"plugins"`
}
type KongConsumerReqDto ¶
type KongConsumerReqDto struct { // 用户名,必填 Username string `json:"username"` // 第三方唯一id,选填 CustomId string `json:"custom_id,omitempty"` }
func NewKongConsumerReqDto ¶
func NewKongConsumerReqDto(name string, customId string) *KongConsumerReqDto
func (KongConsumerReqDto) IsEmpty ¶
func (dto KongConsumerReqDto) IsEmpty() bool
type KongConsumerRespDto ¶
type KongCredentialDto ¶
type KongCredentialDto struct { ConsumerId string `json:"consumer_id,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` Id string `json:"id,omitempty"` // key-auth, sign-auth Key string `json:"key,omitempty"` // oauth2 RedirectUrl interface{} `json:"redirect_uri,omitempty"` // v2 RedirectUrls []string `json:"redirect_uris,omitempty"` Name string `json:"name,omitempty"` ClientId string `json:"client_id,omitempty"` ClientSecret string `json:"client_secret,omitempty"` // sign-auth, hmac-auth Secret string `json:"secret,omitempty"` // hmac-auth Username string `json:"username,omitempty"` }
func FromCredential ¶ added in v1.3.0
func FromCredential(cred *pb.Credential) KongCredentialDto
func (*KongCredentialDto) Compatiable ¶
func (dto *KongCredentialDto) Compatiable()
func (KongCredentialDto) ToCredential ¶ added in v1.3.0
func (dto KongCredentialDto) ToCredential() *pb.Credential
func (*KongCredentialDto) ToHmacReq ¶
func (dto *KongCredentialDto) ToHmacReq()
func (*KongCredentialDto) ToHmacResp ¶
func (dto *KongCredentialDto) ToHmacResp()
func (*KongCredentialDto) ToV2 ¶
func (dto *KongCredentialDto) ToV2()
type KongCredentialListDto ¶
type KongCredentialListDto struct { Total int64 `json:"total"` Data []KongCredentialDto `json:"data"` }
type KongCredentialReqDto ¶
type KongCredentialReqDto struct { // 消费者id,必填 ConsumerId string `json:"consumer_id"` // 插件名称 PluginName string `json:"plugin_name,omitempty"` // 其余选填配置 Config *KongCredentialDto `json:"config,omitempty"` }
type KongPluginReqDto ¶
type KongPluginReqDto struct { // 插件名称,必填 Name string `json:"name"` // 1、服务id ServiceId string `json:"service_id,omitempty"` // 2、路由id RouteId string `json:"route_id,omitempty"` // 3、消费者id ConsumerId string `json:"consumer_id,omitempty"` Route *KongObj `json:"route,omitempty"` Service *KongObj `json:"service,omitempty"` Consumer *KongObj `json:"consumer,omitempty"` // 是否开启,默认true Enabled *bool `json:"enabled,omitempty"` // 其余配置 Config map[string]interface{} `json:"config,omitempty"` Id string `json:"id,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` // 插件id,删除或更新时使用 PluginId string `json:"-"` }
type KongPluginRespDto ¶
type KongPluginRespDto struct { Id string `json:"id"` ServiceId string `json:"service_id"` RouteId string `json:"route_id"` ConsumerId string `json:"consumer_id"` Route *KongObj `json:"route"` Service *KongObj `json:"service"` Consumer *KongObj `json:"consumer"` Name string `json:"name"` Config map[string]interface{} `json:"config"` Enabled bool `json:"enabled"` CreatedAt int64 `json:"created_at"` PolicyId string `json:"-"` }
func (*KongPluginRespDto) Compatiable ¶
func (dto *KongPluginRespDto) Compatiable()
type KongPluginsDto ¶
type KongPluginsDto struct { Total int64 `json:"total"` Data []KongPluginRespDto `json:"data"` }
type KongRouteReqDto ¶
type KongRouteReqDto struct { // 协议列表,默认["http", "https"] Protocols []string `json:"protocols,omitempty"` // 以下三个参数至少需要填一个 // 1、方法列表 Methods []string `json:"methods,omitempty"` // 2、主机列表 Hosts []string `json:"hosts,omitempty"` // 3、路径列表 Paths []string `json:"paths,omitempty"` // 选填,当通过路径之一匹配路由时,从上游请求URL中去除匹配的前缀。 StripPath *bool `json:"strip_path,omitempty"` // 选填,当通过主机域名中的一个匹配路由时,在上游请求报头中使用请求主机头。 // 默认情况下设置为false,上游主机头将设置为服务的主机。 PreserveHost *bool `json:"preserve_host,omitempty"` // 绑定服务,必填 Service *Service `json:"service,omitempty"` // 正则匹配优先级,当前使用路径中/的个数 RegexPriority int `json:"regex_priority,omitempty"` // 真正的路由id,更新时使用 RouteId string `json:"-"` }
type KongRouteRespDto ¶
type KongRoutesRespDto ¶
type KongRoutesRespDto struct {
Routes []KongRouteRespDto `json:"data"`
}
type KongServiceReqDto ¶
type KongServiceReqDto struct { // 服务名称,选填 Name string `json:"name,omitempty"` // 具体路径,如果设置了这个可以不设下面4个 Url string `json:"url,omitempty"` // 1、协议,默认http Protocol string `json:"protocol,omitempty"` // 2、主机,没设url则必传 Host string `json:"host,omitempty"` // 3、端口,默认80 Port int `json:"port,omitempty"` // 4、路径,默认null Path string `json:"path,omitempty"` // 选填,重试次数 Retries *int `json:"retries,omitempty"` // 选填,连接超时时间 ConnectTimeout int `json:"connect_timeout,omitempty"` // 选填,写超时时间 WriteTimeout int `json:"write_timeout,omitempty"` // 选填,读超时时间 ReadTimeout int `json:"read_timeout,omitempty"` // 真正的服务id,更新时使用 ServiceId string `json:"-"` }
type KongServiceRespDto ¶
type KongTargetDto ¶
type KongUpstreamDto ¶
type KongUpstreamDto struct { Id string `json:"id,omitempty"` Name string `json:"name"` Healthchecks HealthchecksDto `json:"healthchecks"` }
type KongUpstreamStatusRespDto ¶
type KongUpstreamStatusRespDto struct {
Data []KongTargetDto `json:"data"`
}
type PassiveHealthcheckDto ¶
type PassiveHealthcheckDto struct { Healthy HealthyDto `json:"healthy,omitempty"` Unhealthy UnhealthyDto `json:"unhealthy,omitempty"` }
type UnhealthyDto ¶
type UnhealthyDto struct { // 默认是0 active下关闭探测 Interval int `json:"interval,omitempty"` // active默认是[429, 404, 500, 501, 502, 503, 504, 505] passive默认是[429, 500, 503] HttpStatuses []int `json:"http_statuses,omitempty"` // 默认是0 HttpFailures int `json:"http_failures,omitempty"` // 默认是0 TcpFailures int `json:"tcp_failures,omitempty"` // 默认是0 Timeouts int `json:"timeouts,omitempty"` }
Source Files
¶
- kong_consumer_req_dto.go
- kong_consumer_resp_dto.go
- kong_credential_req_dto.go
- kong_credential_resp_dto.go
- kong_enabled_plugins_dto.go
- kong_plugin_req_dto.go
- kong_plugin_resp_dto.go
- kong_route_req_dto.go
- kong_route_resp_dto.go
- kong_service_req_dto.go
- kong_service_resp_dto.go
- kong_target_dto.go
- kong_upstream_dto.go
Click to show internal directories.
Click to hide internal directories.