Documentation ¶
Index ¶
- Constants
- func GetEnvVarOrDefault(key string, defaultValue string) string
- type Api
- type ApiClient
- func (apiClient *ApiClient) Create(newApi *ApiRequest) (*Api, error)
- func (apiClient *ApiClient) DeleteById(id string) error
- func (apiClient *ApiClient) DeleteByName(name string) error
- func (apiClient *ApiClient) GetById(id string) (*Api, error)
- func (apiClient *ApiClient) GetByName(name string) (*Api, error)
- func (apiClient *ApiClient) List() (*Apis, error)
- func (apiClient *ApiClient) ListFiltered(filter *ApiFilter) (*Apis, error)
- func (apiClient *ApiClient) UpdateById(id string, apiRequest *ApiRequest) (*Api, error)
- func (apiClient *ApiClient) UpdateByName(name string, apiRequest *ApiRequest) (*Api, error)
- type ApiFilter
- type ApiRequest
- type Apis
- type Certificate
- type CertificateClient
- func (certificateClient *CertificateClient) Create(certificateRequest *CertificateRequest) (*Certificate, error)
- func (certificateClient *CertificateClient) DeleteById(id string) error
- func (certificateClient *CertificateClient) GetById(id string) (*Certificate, error)
- func (certificateClient *CertificateClient) List() (*Certificates, error)
- func (certificateClient *CertificateClient) UpdateById(id string, certificateRequest *CertificateRequest) (*Certificate, error)
- type CertificateRequest
- type Certificates
- type Config
- type Consumer
- type ConsumerClient
- func (consumerClient *ConsumerClient) Create(consumerRequest *ConsumerRequest) (*Consumer, error)
- func (consumerClient *ConsumerClient) DeleteById(id string) error
- func (consumerClient *ConsumerClient) DeleteByUsername(username string) error
- func (consumerClient *ConsumerClient) GetById(id string) (*Consumer, error)
- func (consumerClient *ConsumerClient) GetByUsername(username string) (*Consumer, error)
- func (consumerClient *ConsumerClient) List() (*Consumers, error)
- func (consumerClient *ConsumerClient) ListFiltered(filter *ConsumerFilter) (*Consumers, error)
- func (consumerClient *ConsumerClient) UpdateById(id string, consumerRequest *ConsumerRequest) (*Consumer, error)
- func (consumerClient *ConsumerClient) UpdateByUsername(username string, consumerRequest *ConsumerRequest) (*Consumer, error)
- type ConsumerCredentialJWT
- type ConsumerCredentialJWTClient
- func (consumerClient *ConsumerCredentialJWTClient) Create(consumerRequest *ConsumerCredentialJWTRequest) (*ConsumerCredentialJWT, error)
- func (consumerClient *ConsumerCredentialJWTClient) DeleteById(consumerId, id string) error
- func (consumerClient *ConsumerCredentialJWTClient) GetById(consumerId, id string) (*ConsumerCredentialJWT, error)
- func (consumerClient *ConsumerCredentialJWTClient) List(consumerId string) (*ConsumerCredentialJWTs, error)
- type ConsumerCredentialJWTFilter
- type ConsumerCredentialJWTRequest
- type ConsumerCredentialJWTs
- type ConsumerFilter
- type ConsumerRequest
- type Consumers
- type KongAdminClient
- func (kongAdminClient *KongAdminClient) Apis() *ApiClient
- func (kongAdminClient *KongAdminClient) Certificates() *CertificateClient
- func (kongAdminClient *KongAdminClient) ConsumerCredentialJWT() *ConsumerCredentialJWTClient
- func (kongAdminClient *KongAdminClient) Consumers() *ConsumerClient
- func (client *KongAdminClient) Delete(url string) (*http.Response, []byte, error)
- func (client *KongAdminClient) Get(url string) (*http.Response, []byte, error)
- func (client *KongAdminClient) Patch(url string, val interface{}) (*http.Response, []byte, error)
- func (kongAdminClient *KongAdminClient) Plugins() *PluginClient
- func (client *KongAdminClient) Post(url string, val interface{}) (*http.Response, []byte, error)
- func (kongAdminClient *KongAdminClient) Snis() *SnisClient
- func (kongAdminClient *KongAdminClient) Status() *StatusClient
- func (kongAdminClient *KongAdminClient) Upstreams() *UpstreamClient
- type Plugin
- type PluginClient
- func (pluginClient *PluginClient) Create(pluginRequest *PluginRequest) (*Plugin, error)
- func (pluginClient *PluginClient) DeleteById(id string) error
- func (pluginClient *PluginClient) GetById(id string) (*Plugin, error)
- func (pluginClient *PluginClient) List() (*Plugins, error)
- func (pluginClient *PluginClient) ListFiltered(filter *PluginFilter) (*Plugins, error)
- func (pluginClient *PluginClient) UpdateById(id string, pluginRequest *PluginRequest) (*Plugin, error)
- type PluginFilter
- type PluginRequest
- type Plugins
- type Sni
- type Snis
- type SnisClient
- func (snisClient *SnisClient) Create(snisRequest *SnisRequest) (*Sni, error)
- func (snisClient *SnisClient) DeleteByName(name string) error
- func (snisClient *SnisClient) GetByName(name string) (*Sni, error)
- func (snisClient *SnisClient) List() (*Snis, error)
- func (snisClient *SnisClient) UpdateByName(name string, snisRequest *SnisRequest) (*Sni, error)
- type SnisRequest
- type Status
- type StatusClient
- type Upstream
- type UpstreamClient
- func (upstreamClient *UpstreamClient) Create(upstreamRequest *UpstreamRequest) (*Upstream, error)
- func (upstreamClient *UpstreamClient) DeleteById(id string) error
- func (upstreamClient *UpstreamClient) DeleteByName(name string) error
- func (upstreamClient *UpstreamClient) GetById(id string) (*Upstream, error)
- func (upstreamClient *UpstreamClient) GetByName(name string) (*Upstream, error)
- func (upstreamClient *UpstreamClient) List() (*Upstreams, error)
- func (upstreamClient *UpstreamClient) ListFiltered(filter *UpstreamFilter) (*Upstreams, error)
- func (upstreamClient *UpstreamClient) UpdateById(id string, upstreamRequest *UpstreamRequest) (*Upstream, error)
- func (upstreamClient *UpstreamClient) UpdateByName(name string, upstreamRequest *UpstreamRequest) (*Upstream, error)
- type UpstreamFilter
- type UpstreamRequest
- type Upstreams
Constants ¶
View Source
const ApisPath = "/apis/"
View Source
const CertificatesPath = "/certificates/"
View Source
const ConsumerCredentialJWTFormat = "/consumers/%s/jwt"
View Source
const ConsumerCredentialJWTPath = "/consumers/"
View Source
const ConsumersPath = "/consumers/"
View Source
const EnvKongAdminHostAddress = "KONG_ADMIN_ADDR"
View Source
const PluginsPath = "/plugins/"
View Source
const SnisPath = "/snis/"
View Source
const UpstreamsPath = "/upstreams/"
Variables ¶
This section is empty.
Functions ¶
func GetEnvVarOrDefault ¶
Types ¶
type Api ¶
type Api struct { Id string `json:"id"` CreatedAt int `json:"created_at"` Name string `json:"name"` Hosts []string `json:"hosts,omitempty"` Uris []string `json:"uris,omitempty"` Methods []string `json:"methods,omitempty"` UpstreamUrl string `json:"upstream_url"` StripUri bool `json:"strip_uri,omitempty"` PreserveHost bool `json:"preserve_host,omitempty"` Retries int `json:"retries,omitempty"` UpstreamConnectTimeout int `json:"upstream_connect_timeout,omitempty"` UpstreamSendTimeout int `json:"upstream_send_timeout,omitempty"` UpstreamReadTimeout int `json:"upstream_read_timeout,omitempty"` HttpsOnly bool `json:"https_only,omitempty"` HttpIfTerminated bool `json:"http_if_terminated,omitempty"` }
func UnmarshalAPI ¶ added in v1.0.8
type ApiClient ¶
type ApiClient struct {
// contains filtered or unexported fields
}
func (*ApiClient) DeleteById ¶
func (*ApiClient) DeleteByName ¶
func (*ApiClient) ListFiltered ¶
func (*ApiClient) UpdateById ¶
func (apiClient *ApiClient) UpdateById(id string, apiRequest *ApiRequest) (*Api, error)
func (*ApiClient) UpdateByName ¶
func (apiClient *ApiClient) UpdateByName(name string, apiRequest *ApiRequest) (*Api, error)
type ApiRequest ¶
type ApiRequest struct { Name string `json:"name"` Hosts []string `json:"hosts,omitempty"` Uris []string `json:"uris,omitempty"` Methods []string `json:"methods,omitempty"` UpstreamUrl string `json:"upstream_url"` StripUri bool `json:"strip_uri"` PreserveHost bool `json:"preserve_host,omitempty"` Retries int `json:"retries,omitempty"` UpstreamConnectTimeout int `json:"upstream_connect_timeout,omitempty"` UpstreamSendTimeout int `json:"upstream_send_timeout,omitempty"` UpstreamReadTimeout int `json:"upstream_read_timeout,omitempty"` HttpsOnly bool `json:"https_only,omitempty"` HttpIfTerminated bool `json:"http_if_terminated,omitempty"` }
type Apis ¶
type Apis struct { Results []*Api `json:"data,omitempty"` Total int `json:"total,omitempty"` Next string `json:"next,omitempty"` Offset string `json:"offset,omitempty"` }
func UnmarshalAPIs ¶ added in v1.0.8
type Certificate ¶
type CertificateClient ¶
type CertificateClient struct {
// contains filtered or unexported fields
}
func (*CertificateClient) Create ¶
func (certificateClient *CertificateClient) Create(certificateRequest *CertificateRequest) (*Certificate, error)
func (*CertificateClient) DeleteById ¶
func (certificateClient *CertificateClient) DeleteById(id string) error
func (*CertificateClient) GetById ¶
func (certificateClient *CertificateClient) GetById(id string) (*Certificate, error)
func (*CertificateClient) List ¶
func (certificateClient *CertificateClient) List() (*Certificates, error)
func (*CertificateClient) UpdateById ¶
func (certificateClient *CertificateClient) UpdateById(id string, certificateRequest *CertificateRequest) (*Certificate, error)
type CertificateRequest ¶
type Certificates ¶
type Certificates struct { Results []*Certificate `json:"data,omitempty"` Total int `json:"total,omitempty"` }
type Config ¶
type Config struct { HostAddress string // contains filtered or unexported fields }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type ConsumerClient ¶
type ConsumerClient struct {
// contains filtered or unexported fields
}
func (*ConsumerClient) Create ¶
func (consumerClient *ConsumerClient) Create(consumerRequest *ConsumerRequest) (*Consumer, error)
func (*ConsumerClient) DeleteById ¶
func (consumerClient *ConsumerClient) DeleteById(id string) error
func (*ConsumerClient) DeleteByUsername ¶
func (consumerClient *ConsumerClient) DeleteByUsername(username string) error
func (*ConsumerClient) GetById ¶
func (consumerClient *ConsumerClient) GetById(id string) (*Consumer, error)
func (*ConsumerClient) GetByUsername ¶
func (consumerClient *ConsumerClient) GetByUsername(username string) (*Consumer, error)
func (*ConsumerClient) List ¶
func (consumerClient *ConsumerClient) List() (*Consumers, error)
func (*ConsumerClient) ListFiltered ¶
func (consumerClient *ConsumerClient) ListFiltered(filter *ConsumerFilter) (*Consumers, error)
func (*ConsumerClient) UpdateById ¶
func (consumerClient *ConsumerClient) UpdateById(id string, consumerRequest *ConsumerRequest) (*Consumer, error)
func (*ConsumerClient) UpdateByUsername ¶
func (consumerClient *ConsumerClient) UpdateByUsername(username string, consumerRequest *ConsumerRequest) (*Consumer, error)
type ConsumerCredentialJWT ¶ added in v1.0.4
type ConsumerCredentialJWTClient ¶ added in v1.0.4
type ConsumerCredentialJWTClient struct {
// contains filtered or unexported fields
}
func (*ConsumerCredentialJWTClient) Create ¶ added in v1.0.4
func (consumerClient *ConsumerCredentialJWTClient) Create(consumerRequest *ConsumerCredentialJWTRequest) (*ConsumerCredentialJWT, error)
func (*ConsumerCredentialJWTClient) DeleteById ¶ added in v1.0.4
func (consumerClient *ConsumerCredentialJWTClient) DeleteById(consumerId, id string) error
func (*ConsumerCredentialJWTClient) GetById ¶ added in v1.0.4
func (consumerClient *ConsumerCredentialJWTClient) GetById(consumerId, id string) (*ConsumerCredentialJWT, error)
func (*ConsumerCredentialJWTClient) List ¶ added in v1.0.4
func (consumerClient *ConsumerCredentialJWTClient) List(consumerId string) (*ConsumerCredentialJWTs, error)
type ConsumerCredentialJWTFilter ¶ added in v1.0.4
type ConsumerCredentialJWTFilter struct { Id string `url:"id,omitempty"` Key string `json:"key,omitempty"` Secret string `json:"secret,omitempty"` ConsumerId string `json:"consumer_id,omitempty"` Algorithm string `json:"algorithm,omitempty"` RSAPublicKey string `json:"rsa_public_key,omitempty"` Size int `url:"size,omitempty"` Offset int `url:"offset,omitempty"` }
type ConsumerCredentialJWTRequest ¶ added in v1.0.4
type ConsumerCredentialJWTs ¶ added in v1.0.4
type ConsumerCredentialJWTs struct { Results []*ConsumerCredentialJWT `json:"data,omitempty"` Total int `json:"total,omitempty"` Next string `json:"next,omitempty"` }
type ConsumerFilter ¶
type ConsumerRequest ¶
type KongAdminClient ¶
type KongAdminClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config *Config) *KongAdminClient
func (*KongAdminClient) Apis ¶
func (kongAdminClient *KongAdminClient) Apis() *ApiClient
func (*KongAdminClient) Certificates ¶
func (kongAdminClient *KongAdminClient) Certificates() *CertificateClient
func (*KongAdminClient) ConsumerCredentialJWT ¶ added in v1.0.4
func (kongAdminClient *KongAdminClient) ConsumerCredentialJWT() *ConsumerCredentialJWTClient
func (*KongAdminClient) Consumers ¶
func (kongAdminClient *KongAdminClient) Consumers() *ConsumerClient
func (*KongAdminClient) Plugins ¶
func (kongAdminClient *KongAdminClient) Plugins() *PluginClient
func (*KongAdminClient) Snis ¶
func (kongAdminClient *KongAdminClient) Snis() *SnisClient
func (*KongAdminClient) Status ¶
func (kongAdminClient *KongAdminClient) Status() *StatusClient
func (*KongAdminClient) Upstreams ¶
func (kongAdminClient *KongAdminClient) Upstreams() *UpstreamClient
type PluginClient ¶
type PluginClient struct {
// contains filtered or unexported fields
}
func (*PluginClient) Create ¶
func (pluginClient *PluginClient) Create(pluginRequest *PluginRequest) (*Plugin, error)
func (*PluginClient) DeleteById ¶
func (pluginClient *PluginClient) DeleteById(id string) error
func (*PluginClient) GetById ¶
func (pluginClient *PluginClient) GetById(id string) (*Plugin, error)
func (*PluginClient) List ¶
func (pluginClient *PluginClient) List() (*Plugins, error)
func (*PluginClient) ListFiltered ¶
func (pluginClient *PluginClient) ListFiltered(filter *PluginFilter) (*Plugins, error)
func (*PluginClient) UpdateById ¶
func (pluginClient *PluginClient) UpdateById(id string, pluginRequest *PluginRequest) (*Plugin, error)
type PluginFilter ¶
type PluginRequest ¶
type SnisClient ¶
type SnisClient struct {
// contains filtered or unexported fields
}
func (*SnisClient) Create ¶
func (snisClient *SnisClient) Create(snisRequest *SnisRequest) (*Sni, error)
func (*SnisClient) DeleteByName ¶
func (snisClient *SnisClient) DeleteByName(name string) error
func (*SnisClient) List ¶
func (snisClient *SnisClient) List() (*Snis, error)
func (*SnisClient) UpdateByName ¶
func (snisClient *SnisClient) UpdateByName(name string, snisRequest *SnisRequest) (*Sni, error)
type SnisRequest ¶
type Status ¶
type Status struct { Server serverStatus `json:"server"` Database databaseStatus `json:"database"` }
type StatusClient ¶
type StatusClient struct {
// contains filtered or unexported fields
}
func (*StatusClient) GetStatus ¶ added in v1.0.2
func (statusClient *StatusClient) GetStatus() (*Status, error)
type UpstreamClient ¶
type UpstreamClient struct {
// contains filtered or unexported fields
}
func (*UpstreamClient) Create ¶
func (upstreamClient *UpstreamClient) Create(upstreamRequest *UpstreamRequest) (*Upstream, error)
func (*UpstreamClient) DeleteById ¶
func (upstreamClient *UpstreamClient) DeleteById(id string) error
func (*UpstreamClient) DeleteByName ¶
func (upstreamClient *UpstreamClient) DeleteByName(name string) error
func (*UpstreamClient) GetById ¶
func (upstreamClient *UpstreamClient) GetById(id string) (*Upstream, error)
func (*UpstreamClient) GetByName ¶
func (upstreamClient *UpstreamClient) GetByName(name string) (*Upstream, error)
func (*UpstreamClient) List ¶
func (upstreamClient *UpstreamClient) List() (*Upstreams, error)
func (*UpstreamClient) ListFiltered ¶
func (upstreamClient *UpstreamClient) ListFiltered(filter *UpstreamFilter) (*Upstreams, error)
func (*UpstreamClient) UpdateById ¶
func (upstreamClient *UpstreamClient) UpdateById(id string, upstreamRequest *UpstreamRequest) (*Upstream, error)
func (*UpstreamClient) UpdateByName ¶
func (upstreamClient *UpstreamClient) UpdateByName(name string, upstreamRequest *UpstreamRequest) (*Upstream, error)
type UpstreamFilter ¶
type UpstreamRequest ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.