Documentation
¶
Index ¶
- Constants
- Variables
- type ACL
- type ACLBody
- type ACLConfig
- type ACLConsumer
- type API
- type APIList
- type Apis
- func (ka *Apis) AsMap() map[string]API
- func (ka *Apis) AsRaw() *API
- func (ka *Apis) Create(body API) *Apis
- func (ka *Apis) Delete(id string) error
- func (ka *Apis) Error() error
- func (ka *Apis) Exist(id string) bool
- func (ka *Apis) Get(id string) *Apis
- func (ka *Apis) GetACL() []string
- func (ka *Apis) Plugins() map[string]Plugin
- func (ka *Apis) Purge() error
- func (ka *Apis) RemoveAuthentication(auth Authentication) error
- func (ka *Apis) RevokeACL(group string) error
- func (ka *Apis) SetACL(groups []string) error
- func (ka *Apis) SetAuthentication(auth Authentication) error
- func (ka *Apis) Update(body API) *Apis
- type ApisOperations
- type Authentication
- type BasicAuthentication
- type BasicKeyAuth
- type Client
- func (k *Client) CheckConnection() error
- func (k *Client) CheckStatus() (map[string]int, error)
- func (k *Client) DatabaseReachable() bool
- func (k *Client) Hostname() string
- func (k *Client) LuaVersion() string
- func (k *Client) New(base *url.URL) *Client
- func (k *Client) NodeID() string
- func (k *Client) SetBasicAuth(username, password string)
- func (k *Client) StatusCode() int
- func (k *Client) Version() string
- type ClientCertificate
- type ClientOperations
- type ClusterInfo
- type ClusterStatus
- type Consumer
- type Consumers
- func (kc *Consumers) AsMap() map[string]Consumer
- func (kc *Consumers) AsRaw() *Consumer
- func (kc *Consumers) ByKey(key string) *Consumer
- func (kc *Consumers) Create(body Consumer) *Consumers
- func (kc *Consumers) CreateKeyAuth() error
- func (kc *Consumers) Delete(id string) error
- func (kc *Consumers) DeleteKeyAuth(key string) error
- func (kc *Consumers) Error() error
- func (kc *Consumers) Exist(id string) bool
- func (kc *Consumers) Get(id string) *Consumers
- func (kc *Consumers) GetACL() []string
- func (kc *Consumers) GetKeyAuth() map[string]KeyAuthData
- func (kc *Consumers) Plugins() map[string]Plugin
- func (kc *Consumers) Purge() error
- func (kc *Consumers) RevokeACL(group string) error
- func (kc *Consumers) SetACL(groups []string) error
- func (kc *Consumers) SetKeyAuth(key string) error
- func (kc *Consumers) Update(body Consumer) *Consumers
- type ConsumersList
- type ConsumersOperations
- type EnabledPlugins
- type FailureMessage
- type HMACAuthentication
- type JWTAuthentication
- type KeyAuthData
- type KeyAuthentication
- type ListenerDefinition
- type OAuth2Authentication
- type Plugin
- type PluginList
- type Plugins
- type PluginsOperations
- type Route
- type RouteList
- type Routes
- func (kr *Routes) AsMap() map[string]Route
- func (kr *Routes) AsRaw() *Route
- func (kr *Routes) Create(body Route) *Routes
- func (kr *Routes) Delete(id string) error
- func (kr *Routes) Error() error
- func (kr *Routes) Exist(id string) bool
- func (kr *Routes) Get(id string) *Routes
- func (kr *Routes) Plugins() map[string]Plugin
- func (kr *Routes) Purge() error
- func (kr *Routes) Update(body Route) *Routes
- type RoutesOperations
- type Service
- type ServiceList
- type ServiceRelation
- type Services
- func (ks *Services) AsMap() map[string]Service
- func (ks *Services) AsRaw() *Service
- func (ks *Services) Create(body Service) *Services
- func (ks *Services) CreateRoute(body Route) *Route
- func (ks *Services) Delete(id string) error
- func (ks *Services) DeleteRoute(id string) error
- func (ks *Services) Error() error
- func (ks *Services) Exist(id string) bool
- func (ks *Services) Get(id string) *Services
- func (ks *Services) GetACL() []string
- func (ks *Services) Plugins() map[string]Plugin
- func (ks *Services) Purge() error
- func (ks *Services) RemoveAuthentication(auth Authentication) error
- func (ks *Services) RevokeACL(group string) error
- func (ks *Services) Routes() map[string]Route
- func (ks *Services) SetACL(groups []string) error
- func (ks *Services) SetAuthentication(auth Authentication) error
- func (ks *Services) Update(body Service) *Services
- type ServicesOperations
Constants ¶
const ( // StatusURI is a Kong server status endpoint StatusURI string = "/status" // ServicesURI is a Kong server service endpoint on Kong version >= 0.13.x ServicesURI string = "/services" // RoutesURI is a Kong server routes endpoint on Kong version >= 0.13.x RoutesURI string = "/routes" // ApisURI is a Kong server apis endpoint on Kong version < 0.13.x ApisURI string = "/apis" // ConsumerURI is a Kong server consumer Key-Auth endpoint ConsumerURI string = "/consumer" // ConsumersURI is a Kong server consumers endpoint ConsumersURI string = "/consumers" // PluginsURI is a Kong server plugins endpoint PluginsURI string = "/plugins" // AclsURI is a Kong server plugins acls endpoint AclsURI string = "/acls" // KeyAuthURI is a Kong server key-auth consumers endpoint KeyAuthURI string = "key-auth" // KeyAuthsURI is a Kong server (>= v1.1.2) endpoint for GetConsumerByKey KeyAuthsURI string = "/key-auths" // RequestSize max request size RequestSize string = "1000" )
const ( Basic Authentication = "basic-auth" JWT = "jwt" HMAC = "hmac-auth" KeyAuth = "key-auth" LDAP = "ldap-auth" OAuth = "oauth2" Session = "session" )
Authentication enum datatype
Variables ¶
var Logger = logger.NewLogger(false)
Logger default
Functions ¶
This section is empty.
Types ¶
type ACL ¶ added in v1.3.4
type ACL struct {
ID string `json:"id,omitempty"`
Consumer interface{} `json:"consumer,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
Group string `json:"group,omitempty"`
Tags []string `json:"tags,omitempty"`
}
ACL holds groups information of a consumer
type ACLBody ¶ added in v1.2.5
type ACLBody struct {
HideGroupsHeader bool `json:"hide_groups_header,omitempty"`
Blacklist []string `json:"blacklist,omitempty"`
Whitelist []string `json:"whitelist,omitempty"`
}
ACLBody holds config for acl plugin
type ACLConfig ¶ added in v1.2.0
type ACLConfig struct {
HideGroupsHeader bool `json:"hide_groups_header,omitempty"`
Blacklist []string `json:"blacklist,omitempty"`
Whitelist []string `json:"whitelist,omitempty"`
}
ACLConfig holds config for acl plugin
type ACLConsumer ¶ added in v1.3.4
ACLConsumer holds config for acls of a consumer
type API ¶ added in v1.2.9
type API struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
RequestPath string `json:"request_path,omitempty"`
Upstream string `json:"upstream_url,omitempty"`
StripPath bool `json:"strip_request_path,omitempty"`
PreserveHost bool `json:"preserve_host,omitempty"`
Created int64 `json:"created_at,omitempty"`
}
API representation
type APIList ¶ added in v1.2.9
type APIList struct {
Data []API `json:"data,omitempty"`
Next string `json:"next,omitempty"`
Total int `json:"total,omitempty"`
}
APIList holds a list of Kong API
type Apis ¶ added in v1.2.0
type Apis struct {
// contains filtered or unexported fields
}
Apis implements ApisOperations interface{}
func (*Apis) RemoveAuthentication ¶ added in v1.2.0
func (ka *Apis) RemoveAuthentication(auth Authentication) error
RemoveAuthentication delete an entry on apis plugins with type provided
func (*Apis) SetAuthentication ¶ added in v1.2.0
func (ka *Apis) SetAuthentication(auth Authentication) error
SetAuthentication creates an entry on apis plugins with type provided
type ApisOperations ¶ added in v1.2.5
type ApisOperations interface {
Get(id string) *Apis
Exist(id string) bool
Create(body API) *Apis
Update(body API) *Apis
Delete(id string) error
Purge() error
Plugins() map[string]Plugin
GetACL() []string
SetACL(groups []string) error
RevokeACL(group string) error
SetAuthentication(auth Authentication) error
RemoveAuthentication(auth Authentication) error
AsMap() map[string]API
AsRaw() *API
Error() error
}
ApisOperations interface holds Kong Apis Methods
type Authentication ¶ added in v1.2.0
type Authentication string
Authentication just and alias for string to make an enum datatype
type BasicAuthentication ¶ added in v1.2.5
type BasicAuthentication struct {
HideCredentials bool `json:"hide_credentials,omitempty"`
Anonymous bool `json:"anonymous,omitempty"`
}
BasicAuthentication represents config for simple username:password authentication
type BasicKeyAuth ¶
type BasicKeyAuth struct {
Data []KeyAuthData `json:"data,omitempty"`
Total int `json:"total,omitempty"`
}
BasicKeyAuth holds responses when getting all basic auths for a consumer
type Client ¶
type Client struct {
Session *requist.Requist
Info *ClusterInfo
Status *ClusterStatus
Auth string
KongVersion int
URL string
// contains filtered or unexported fields
}
Client Abstraction, implements all base operations against a Kong's server via a Requist instance
func NewFromURL ¶ added in v1.0.9
NewFromURL returns a new Client given a Kong server base url in url/URL type
func (*Client) CheckConnection ¶
CheckConnection check for a valid connection against a Kong server
func (*Client) CheckStatus ¶
CheckStatus returns some metrics from KongAPI server
func (*Client) DatabaseReachable ¶ added in v1.2.0
DatabaseReachable returns availability of database of Kong API server
func (*Client) LuaVersion ¶ added in v1.2.0
LuaVersion returns version of LUA on Kong API server
func (*Client) SetBasicAuth ¶
SetBasicAuth update user and pass
func (*Client) StatusCode ¶
StatusCode returns result code from last request
type ClientCertificate ¶
type ClientCertificate struct {
ID string `json:"id,omitempty"`
}
ClientCertificate just hold client_certificate.id
type ClientOperations ¶ added in v1.2.5
type ClientOperations interface {
New(base *url.URL) *Client
StatusCode() int
CheckConnection() error
CheckStatus() (map[string]int, error)
SetBasicAuth(username, password string)
Version() string
LuaVersion() string
Hostname() string
// contains filtered or unexported methods
}
ClientOperations interface define all Kong Methods
type ClusterInfo ¶ added in v1.2.0
type ClusterInfo struct {
Configuration struct {
AdminIP string `json:"admin_ip,omitempty"`
AdminAccLogs string `json:"admin_acc_logs,omitempty"`
AdminAccessLog string `json:"admin_access_log,omitempty"`
AdminErrorLog string `json:"admin_error_log,omitempty"`
AdminListen interface{} `json:"admin_listen,omitempty"`
AdminListeners []ListenerDefinition `json:"admin_listeners,omitempty"`
AdminListenSsl interface{} `json:"admin_listen_ssl,omitempty"`
AdminSslCertDefault string `json:"admin_ssl_cert_default,omitempty"`
AdminSslCertKeyDefault string `json:"admin_ssl_cert_key_default,omitempty"`
AdminSslEnabled bool `json:"admin_ssl_enabled,omitempty"`
AdminPort int `json:"admin_port,omitempty"`
AnonymousReports bool `json:"anonymous_reports,omitempty"`
CassandraConsistency string `json:"cassandra_consistency,omitempty"`
CassandraContactPoints []string `json:"cassandra_contact_points,omitempty"`
CassandraDataCenters []string `json:"cassandra_data_centers,omitempty"`
CassandraKeyspace string `json:"cassandra_keyspace,omitempty"`
CassandraPort int `json:"cassandra_port,omitempty"`
CassandraUsername string `json:"cassandra_username,omitempty"`
ClusterControlPlane string `json:"cluster_control_plane,omitempty"`
ClusterListen interface{} `json:"cluster_listen,omitempty"`
ClusterListeners []ListenerDefinition `json:"cluster_listeners,omitempty"`
Database string `json:"database,omitempty"`
KongEnv string `json:"kong_env,omitempty"`
LoadedPlugins map[string]bool `json:"loaded_plugins,omitempty"`
LogLevel string `json:"log_level,omitempty"`
LuaPackageCpath string `json:"lua_package_cpath,omitempty"`
LuaPackagePath string `json:"lua_package_path,omitempty"`
LuaSslVerifyDepth int `json:"lua_ssl_verify_depth,omitempty"`
MemCacheSize string `json:"mem_cache_size,omitempty"`
NginxAccLogs string `json:"nginx_acc_logs,omitempty"`
NginxConf string `json:"nginx_conf,omitempty"`
NginxDaemon string `json:"nginx_daemon,omitempty"`
NginxErrLogs string `json:"nginx_err_logs,omitempty"`
NginxKongConf string `json:"nginx_kong_conf,omitempty"`
NginxKongStreamConf string `json:"nginx_kong_stream_conf,omitempty"`
NginxOptimizations bool `json:"nginx_optimizations,omitempty"`
NginxPid string `json:"nginx_pid,omitempty"`
NginxWorkerProcesses string `json:"nginx_worker_processes,omitempty"`
PgDatabase string `json:"pg_database,omitempty"`
PgHost string `json:"pg_host,omitempty"`
PgPassword string `json:"pg_password,omitempty"`
PgPort int `json:"pg_port,omitempty"`
PgSsl bool `json:"pg_ssl,omitempty"`
PgSslVerify bool `json:"pg_ssl_verify,omitempty"`
PgUser string `json:"pg_user,omitempty"`
Plugins interface{} `json:"plugins,omitempty"`
Prefix string `json:"prefix,omitempty"`
ProxyIP string `json:"proxy_ip,omitempty"`
ProxyListen interface{} `json:"proxy_listen,omitempty"`
ProxyListeners []ListenerDefinition `json:"proxy_listeners,omitempty"`
ProxyListenSsl interface{} `json:"proxy_listen_ssl,omitempty"`
ProxyPort int `json:"proxy_port,omitempty"`
ProxySslIP string `json:"proxy_ssl_ip,omitempty"`
ProxySslPort int `json:"proxy_ssl_port,omitempty"`
SslCert string `json:"ssl_cert,omitempty"`
SslCertCsrDefault string `json:"ssl_cert_csr_default,omitempty"`
SslCertDefault string `json:"ssl_cert_default,omitempty"`
SslCertKey string `json:"ssl_cert_key,omitempty"`
SslCertKeyDefault string `json:"ssl_cert_key_default,omitempty"`
SslCipherSuite string `json:"ssl_cipher_suite,omitempty"`
SslCiphers string `json:"ssl_ciphers,omitempty"`
StatusAccessLog string `json:"status_access_log,omitempty"`
StatusErrorLog string `json:"status_error_log,omitempty"`
StatusListen []string `json:"status_listen,omitempty"`
StatusListeners interface{} `json:"status_listeners,omitempty"`
TrustedIPs interface{} `json:"trusted_ips,omitempty"`
UpstreamKeepAlive int `json:"upstream_keepalive,omitempty"`
} `json:"configuration,omitempty"`
Hostname string `json:"hostname,omitempty"`
LuaVersion string `json:"lua_version,omitempty"`
NodeID string `json:"node_id,omitempty"`
Plugins struct {
AvailableOnServer map[string]bool `json:"available_on_server,omitempty"`
EnabledInCluster []string `json:"enabled_in_cluster,omitempty"`
} `json:"plugins,omitempty"`
Tagline string `json:"tagline,omitempty"`
Timers struct {
Pending int `json:"pending,omitempty"`
Running int `json:"running,omitempty"`
} `json:"timers,omitempty"`
Version string `json:"version,omitempty"`
}
ClusterInfo holds all data for the endpoint / (root)
type ClusterStatus ¶ added in v1.0.0
type ClusterStatus struct {
Database struct {
Reachable bool `json:"reachable,omitempty"`
} `json:"database,omitempty"`
Server struct {
ConnectionsWriting int `json:"connections_writing,omitempty"`
ConnectionsHandled int `json:"connections_handled,omitempty"`
ConnectionsAccepted int `json:"connections_accepted,omitempty"`
ConnectionsReading int `json:"connections_reading,omitempty"`
ConnectionsActive int `json:"connections_active,omitempty"`
ConnectionsWaiting int `json:"connections_waiting,omitempty"`
TotalRequests int `json:"total_requests,omitempty"`
} `json:"server,omitempty"`
}
ClusterStatus holds all data for the endpoint /status
type Consumer ¶ added in v1.2.0
type Consumer struct {
ID string `json:"id,omitempty"`
Username string `json:"username,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
CustomID string `json:"custom_id,omitempty"`
Tags []string `json:"tags,omitempty"`
}
Consumer holds request body for POST/PUT/PATCH schema://server:port/consumers/
type Consumers ¶ added in v1.2.0
type Consumers struct {
// contains filtered or unexported fields
}
Consumers implements ConsumersOperations interface{}
func NewConsumers ¶ added in v1.2.0
NewConsumers returns Consumers implementation
func (*Consumers) CreateKeyAuth ¶ added in v1.2.0
CreateKeyAuth create a new basic auth key for a consumer
func (*Consumers) DeleteKeyAuth ¶ added in v1.2.0
DeleteKeyAuth remove basic auth key for a consumer
func (*Consumers) GetKeyAuth ¶ added in v1.2.0
func (kc *Consumers) GetKeyAuth() map[string]KeyAuthData
GetKeyAuth return all basic auth of a consumer
func (*Consumers) SetKeyAuth ¶ added in v1.2.0
SetKeyAuth set a key for a consumer
type ConsumersList ¶ added in v1.2.0
type ConsumersList struct {
Data []Consumer `json:"data,omitempty"`
Next string `json:"next,omitempty"`
Total int `json:"total,omitempty"`
}
ConsumersList holds responses when getting all consumers ( GET schema://server:port/consumers/ )
type ConsumersOperations ¶ added in v1.2.5
type ConsumersOperations interface {
Get(id string) *Consumers
Exist(id string) bool
Create(body Consumer) *Consumers
Update(body Consumer) *Consumers
Delete(id string) error
Purge() error
GetKeyAuth() map[string]KeyAuthData
SetKeyAuth(key string) error
CreateKeyAuth() error
DeleteKeyAuth(key string) error
ByKey(key string) *Consumer
Plugins() map[string]Plugin
GetACL() []string
SetACL(groups []string) error
RevokeACL(group string) error
AsMap() map[string]Consumer
AsRaw() *Consumer
Error() error
}
ConsumersOperations interface holds Kong Consumers Methods
type EnabledPlugins ¶ added in v1.2.0
type EnabledPlugins struct {
EnabledPlugins []string `json:"enabled_plugins"`
}
EnabledPlugins used when request the plugins enabled on a Kong server
type FailureMessage ¶
type FailureMessage struct {
Message string `json:"message,omitempty"`
}
FailureMessage all failed request match with this datatype
type HMACAuthentication ¶ added in v1.2.5
type HMACAuthentication struct {
ClockSkew int `json:"clock_skew,omitempty"`
HideCredentials bool `json:"hide_credentials,omitempty"`
Anonymous bool `json:"anonymous,omitempty"`
ValidateRequestBody bool `json:"validate_request_body,omitempty"`
EnforceHeaders bool `json:"enforce_headers,omitempty"`
Algorithms bool `json:"algorithms,omitempty"`
}
HMACAuthentication represents config for HMAC authentication
type JWTAuthentication ¶ added in v1.2.5
type JWTAuthentication struct {
URIParamNames []string `json:"uri_param_names,omitempty"`
CookieNames []string `json:"cookie_names,omitempty"`
HeaderNames []string `json:"header_names,omitempty"`
SecretIsBase64 bool `json:"secret_is_base64,omitempty"`
Anonymous string `json:"anonymous,omitempty"`
RunOnPreflight bool `json:"run_on_preflight,omitempty"`
MaximumExpiration int `json:"maximum_expiration,omitempty"`
}
JWTAuthentication represents config for JWT authentication
type KeyAuthData ¶
type KeyAuthData struct {
CreatedAt int64 `json:"created_at,omitempty"`
ConsumerID string `json:"consumer_id,omitempty"`
Key string `json:"key,omitempty"`
ID string `json:"id,omitempty"`
}
KeyAuthData holds response when getting basic auth for a consumer
type KeyAuthentication ¶ added in v1.2.5
type KeyAuthentication struct {
KeyNames []string `json:"key_names,omitempty"`
KeyInBody bool `json:"key_in_body,omitempty"`
Anonymous string `json:"anonymous,omitempty"`
RunOnPreflight bool `json:"run_on_preflight,omitempty"`
HideCredentials bool `json:"hide_credentials,omitempty"`
}
KeyAuthentication represents config for KeyAuth (apikey) authentication
type ListenerDefinition ¶ added in v1.2.0
type ListenerDefinition struct {
Backlog bool `json:"backlog,omitempty"`
Bind bool `json:"bind,omitempty"`
Deferred bool `json:"deferred,omitempty"`
HTTP2 bool `json:"http2,omitempty"`
IP string `json:"ip,omitempty"`
Listener string `json:"listener,omitempty"`
Port int `json:"port,omitempty"`
ProxyProtocol bool `json:"proxy_protocol,omitempty"`
Reuseport bool `json:"reuseport,omitempty"`
Ssl bool `json:"ssl,omitempty"`
}
ListenerDefinition holds all data for a Listen Port definition
type OAuth2Authentication ¶ added in v1.2.5
type OAuth2Authentication struct {
Scopes []string `json:"scopes,omitempty"`
MandatoryScope bool `json:"mandatory_scope,omitempty"`
EnableAuthorizationCode bool `json:"enable_authorization_code,omitempty"`
HashSecret bool `json:"hash_secret,omitempty"`
HideCredentials bool `json:"hide_credentials,omitempty"`
}
OAuth2Authentication represents config for OAuth (OAuth2) authentication
type Plugin ¶ added in v1.2.0
type Plugin struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Created int64 `json:"created_at,omitempty"`
Config interface{} `json:"config,omitempty"`
API interface{} `json:"api_id,omitempty"`
Service interface{} `json:"service,omitempty"`
Consumer interface{} `json:"consumer,omitempty"`
Route interface{} `json:"route,omitempty"`
Protocols interface{} `json:"protocols,omitempty"`
Tags interface{} `json:"tags,omitempty"`
}
Plugin holds responses for a request of create or update a plugin
type PluginList ¶ added in v1.2.0
type PluginList struct {
Data []Plugin `json:"data,omitempty"`
Next string `json:"next,omitempty"`
Total int `json:"total,omitempty"`
}
PluginList holds responses when getting all plugins of a consumers/apis/services or routes
type Plugins ¶ added in v1.2.5
type Plugins struct {
// contains filtered or unexported fields
}
Plugins implements PluginsOperations interface{}
func NewPlugins ¶ added in v1.2.5
NewPlugins returns Plugins implementation
type PluginsOperations ¶ added in v1.2.5
type PluginsOperations interface {
Get(id string) *Plugins
Create(body Plugin) *Plugins
Delete(id string) error
IDByName(name string) string
AsMap() map[string]Plugin
AsRaw() *Plugin
Error() error
// contains filtered or unexported methods
}
PluginsOperations interface holds Kong Plugins Methods
type Route ¶ added in v1.2.0
type Route struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Protocols []string `json:"protocols,omitempty"`
Methods []string `json:"methods,omitempty"`
Hosts []string `json:"hosts,omitempty"`
Paths []string `json:"paths,omitempty"`
Headers []string `json:"headers,omitempty"`
HTTPSRedirectStatusCode int `json:"https_redirect_status_code,omitempty"`
RegexPriority int `json:"regex_priority,omitempty"`
StripPath bool `json:"strip_path,omitempty"`
PreserveHost bool `json:"preserve_host,omitempty"`
PathHandling string `json:"path_handling,omitempty"`
Tags []string `json:"tags,omitempty"`
Service *ServiceRelation `json:"service,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
}
Route represents a Kong Route
type Routes ¶ added in v1.2.0
type Routes struct {
// contains filtered or unexported fields
}
Routes implements RoutesOperations interface{}
type RoutesOperations ¶ added in v1.2.5
type RoutesOperations interface {
Get(id string) *Routes
Exist(id string) bool
Create(body Route) *Routes
Update(body Route) *Routes
Delete(id string) error
Purge() error
Plugins() map[string]Plugin
AsMap() map[string]Route
AsRaw() *Route
Error() error
// contains filtered or unexported methods
}
RoutesOperations interface holds Kong Routes Methods
type Service ¶
type Service struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
Retries int `json:"retries,omitempty"`
URL string `json:"url,omitempty"`
Protocol string `json:"protocol,omitempty"`
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
Path string `json:"path,omitempty"`
ConnectTimeout int `json:"connect_timeout,omitempty"`
WriteTimeout int `json:"write_timeout,omitempty"`
ReadTimeout int `json:"read_timeout,omitempty"`
Tags []string `json:"tags,omitempty"`
ClientCertificate *ClientCertificate `json:"client_certificate,omitempty"`
}
Service represents a Kong Service
type ServiceList ¶ added in v1.2.0
type ServiceList struct {
Data []Service `json:"data"`
Next string `json:"next"`
Total int `json:"total"`
}
ServiceList define an Array of Service
type ServiceRelation ¶ added in v1.2.0
type ServiceRelation struct {
ID string `json:"id,omitempty"`
}
ServiceRelation just used to hold service.id
type Services ¶ added in v1.2.0
type Services struct {
// contains filtered or unexported fields
}
Services implements ServicesOperations interface{}
func NewServices ¶ added in v1.2.0
NewServices returns a new Services client
func (*Services) CreateRoute ¶ added in v1.2.0
CreateRoute create a route on a service
func (*Services) DeleteRoute ¶ added in v1.2.0
DeleteRoute delete a route from a service
func (*Services) RemoveAuthentication ¶ added in v1.2.5
func (ks *Services) RemoveAuthentication(auth Authentication) error
RemoveAuthentication delete an entry on apis plugins with type provided
func (*Services) RevokeACL ¶ added in v1.2.9
RevokeACL delete an entry on services plugins of type acl
func (*Services) SetAuthentication ¶ added in v1.2.5
func (ks *Services) SetAuthentication(auth Authentication) error
SetAuthentication creates an entry on service plugins with type provided
type ServicesOperations ¶ added in v1.2.5
type ServicesOperations interface {
Get(id string) *Services
Exist(id string) bool
Create(body Service) *Services
Update(body Service) *Services
Delete(id string) error
Purge() error
Routes() map[string]Route
CreateRoute(body Route) *Route
DeleteRoute(id string) error
Plugins() map[string]Plugin
GetACL() []string
SetACL(groups []string) error
RevokeACL(group string) error
SetAuthentication(auth Authentication) error
RemoveAuthentication(auth Authentication) error
AsMap() map[string]Service
AsRaw() *Service
Error() error
// contains filtered or unexported methods
}
ServicesOperations interface holds Kong Services Methods