Documentation ¶
Index ¶
- type API
- type APIList
- type APIService
- func (s *APIService) Add(name, Hosts, Uris, upstreamURL string, stripUri, preserveHost bool) (*API, *http.Response, error)
- func (s *APIService) AddOrUpdate(id, name, Hosts, Uris, upstreamURL string, stripUri, preserveHost bool, ...) (*API, *http.Response, error)
- func (s *APIService) AddPlugin(name string, plugin interface{}) (*http.Response, error)
- func (s *APIService) Delete(name string) (*http.Response, error)
- func (s *APIService) Get(name string) (*API, *http.Response, error)
- func (s *APIService) List() (*APIList, *http.Response, error)
- type Client
- type ClusterService
- type ClusterStatus
- type Consumer
- type ConsumerList
- type ConsumerService
- func (s *ConsumerService) BasicAuth(cons, username, password string) (*Consumer, *http.Response, error)
- func (s *ConsumerService) Create(customID, username string) (*Consumer, *http.Response, error)
- func (s *ConsumerService) Get(name string) (*Consumer, *http.Response, error)
- func (s *ConsumerService) List() (*ConsumerList, *http.Response, error)
- type Credentials
- type Node
- type NodeService
- type NodeStatus
- type RequestTransformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Id string `json:"id,omitempty"` CreatedAt int `json:"created_at,omitempty"` Name string `json:"name,omitempty"` PreserveHost bool `json:"preserve_host,omitempty"` Hosts string `json:"hosts,omitempty"` Uris string `json:"uris,omitempty"` StripUri bool `json:"strip_uri,omitempty"` UpstreamURL string `json:"upstream_url"` }
type APIService ¶
type APIService struct {
// contains filtered or unexported fields
}
func NewAPIService ¶
func NewAPIService(httpClient *http.Client, baseUrl string) *APIService
func (*APIService) AddOrUpdate ¶
type Client ¶
type Client struct { BaseURL string NodeService *NodeService ClusterService *ClusterService APIService *APIService ConsumerService *ConsumerService }
Client is a tiny Kong client
type ClusterService ¶
type ClusterService struct {
// contains filtered or unexported fields
}
func NewClusterService ¶
func NewClusterService(httpClient *http.Client, baseUrl string) *ClusterService
NewIssueService returns a new IssueService.
func (*ClusterService) Status ¶
func (s *ClusterService) Status() (*ClusterStatus, *http.Response, error)
type ClusterStatus ¶
type ConsumerList ¶
type ConsumerService ¶
type ConsumerService struct {
// contains filtered or unexported fields
}
func NewConsumerService ¶
func NewConsumerService(httpClient *http.Client, baseUrl string) *ConsumerService
func (*ConsumerService) List ¶
func (s *ConsumerService) List() (*ConsumerList, *http.Response, error)
type Credentials ¶
type Node ¶
type Node struct { Configuration struct { AdminAPIListen string `json:"admin_api_listen"` Cassandra struct { ContactPoints []string `json:"contact_points"` DataCenters struct{} `json:"data_centers"` Keyspace string `json:"keyspace"` ReplicationFactor int `json:"replication_factor"` ReplicationStrategy string `json:"replication_strategy"` Ssl struct { Enabled bool `json:"enabled"` Verify bool `json:"verify"` } `json:"ssl"` Timeout int `json:"timeout"` } `json:"cassandra"` Cluster struct { Auto_join bool `json:"auto-join"` Profile string `json:"profile"` } `json:"cluster"` ClusterListen string `json:"cluster_listen"` ClusterListenRPC string `json:"cluster_listen_rpc"` CustomPlugins struct{} `json:"custom_plugins"` DaoConfig struct { ContactPoints []string `json:"contact_points"` DataCenters struct{} `json:"data_centers"` Keyspace string `json:"keyspace"` ReplicationFactor int `json:"replication_factor"` ReplicationStrategy string `json:"replication_strategy"` Ssl struct { Enabled bool `json:"enabled"` Verify bool `json:"verify"` } `json:"ssl"` Timeout int `json:"timeout"` } `json:"dao_config"` Database string `json:"database"` DNSResolver struct { Address string `json:"address"` Dnsmasq bool `json:"dnsmasq"` Port int `json:"port"` } `json:"dns_resolver"` DNSResolversAvailable struct { Dnsmasq struct { Port int `json:"port"` } `json:"dnsmasq"` Server struct { Address string `json:"address"` } `json:"server"` } `json:"dns_resolvers_available"` MemoryCacheSize int `json:"memory_cache_size"` Nginx string `json:"nginx"` NginxWorkingDir string `json:"nginx_working_dir"` PidFile string `json:"pid_file"` Plugins []string `json:"plugins"` ProxyListen string `json:"proxy_listen"` ProxyListenSsl string `json:"proxy_listen_ssl"` SendAnonymousReports bool `json:"send_anonymous_reports"` } `json:"configuration"` Hostname string `json:"hostname"` LuaVersion string `json:"lua_version"` Plugins struct { AvailableOnServer []string `json:"available_on_server"` EnabledInCluster []string `json:"enabled_in_cluster"` } `json:"plugins"` Tagline string `json:"tagline"` Version string `json:"version"` }
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
IssueService provides methods for creating and reading issues.
func NewNodeService ¶
func NewNodeService(httpClient *http.Client, baseUrl string) *NodeService
NewIssueService returns a new IssueService.
func (*NodeService) Information ¶
func (s *NodeService) Information() (*Node, *http.Response, error)
func (*NodeService) Status ¶
func (s *NodeService) Status() (*NodeStatus, *http.Response, error)
type NodeStatus ¶
type NodeStatus struct { Database struct { Acls int `json:"acls"` Apis int `json:"apis"` BasicauthCredentials int `json:"basicauth_credentials"` Consumers int `json:"consumers"` HmacauthCredentials int `json:"hmacauth_credentials"` JwtSecrets int `json:"jwt_secrets"` KeyauthCredentials int `json:"keyauth_credentials"` Nodes int `json:"nodes"` Oauth2AuthorizationCodes int `json:"oauth2_authorization_codes"` Oauth2Credentials int `json:"oauth2_credentials"` Oauth2Tokens int `json:"oauth2_tokens"` Plugins int `json:"plugins"` RatelimitingMetrics int `json:"ratelimiting_metrics"` ResponseRatelimitingMetrics int `json:"response_ratelimiting_metrics"` } `json:"database"` Server struct { ConnectionsAccepted int `json:"connections_accepted"` ConnectionsActive int `json:"connections_active"` ConnectionsHandled int `json:"connections_handled"` ConnectionsReading int `json:"connections_reading"` ConnectionsWaiting int `json:"connections_waiting"` ConnectionsWriting int `json:"connections_writing"` TotalRequests int `json:"total_requests"` } `json:"server"` }
type RequestTransformer ¶
type RequestTransformer struct { Name string `url:"name"` ConsumerId string `url:"consumer_id,omitempty"` RemoveHeaders string `url:"config.remove.headers,omitempty"` RemoveQuerystring string `url:"config.remove.querystring,omitempty"` RemoveBody string `url:"config.remove.body,omitempty"` ReplaceHeaders string `url:"config.replace.headers,omitempty"` ReplaceQuerystring string `url:"config.replace.querystring,omitempty"` ReplaceBody string `url:"config.replace.body,omitempty"` AddHeaders string `url:"config.add.headers,omitempty"` AddQuerystring string `url:"config.add.querystring,omitempty"` AddBody string `url:"config.add.body,omitempty"` AppendHeaders string `url:"config.append.headers,omitempty"` AppendQuerystring string `url:"config.append.querystring,omitempty"` AppendBody string `url:"config.append.body,omitempty"` }
Click to show internal directories.
Click to hide internal directories.