Documentation ¶
Index ¶
- Constants
- Variables
- type CacheStats
- type Caches
- type Connections
- type ExtendedCacheStats
- type HTTPCache
- type HTTPCodes
- type HTTPLimitConnections
- type HTTPLimitRequest
- type HTTPLimitRequests
- type HTTPRequests
- type HealthChecks
- type KeyValPairs
- type KeyValPairsByZone
- type LicenseReporting
- type LimitConnection
- type LocationZone
- type LocationZones
- type NginxClient
- func (client *NginxClient) AddHTTPServer(ctx context.Context, upstream string, server UpstreamServer) error
- func (client *NginxClient) AddKeyValPair(ctx context.Context, zone string, key string, val string) error
- func (client *NginxClient) AddStreamKeyValPair(ctx context.Context, zone string, key string, val string) error
- func (client *NginxClient) AddStreamServer(ctx context.Context, upstream string, server StreamUpstreamServer) error
- func (client *NginxClient) CheckIfStreamUpstreamExists(ctx context.Context, upstream string) error
- func (client *NginxClient) CheckIfUpstreamExists(ctx context.Context, upstream string) error
- func (client *NginxClient) DeleteHTTPServer(ctx context.Context, upstream string, server string) error
- func (client *NginxClient) DeleteKeyValPairs(ctx context.Context, zone string) error
- func (client *NginxClient) DeleteKeyValuePair(ctx context.Context, zone string, key string) error
- func (client *NginxClient) DeleteStreamKeyValPairs(ctx context.Context, zone string) error
- func (client *NginxClient) DeleteStreamKeyValuePair(ctx context.Context, zone string, key string) error
- func (client *NginxClient) DeleteStreamServer(ctx context.Context, upstream string, server string) error
- func (client *NginxClient) GetAllKeyValPairs(ctx context.Context) (KeyValPairsByZone, error)
- func (client *NginxClient) GetAllStreamKeyValPairs(ctx context.Context) (KeyValPairsByZone, error)
- func (client *NginxClient) GetAvailableEndpoints(ctx context.Context) ([]string, error)
- func (client *NginxClient) GetAvailableStreamEndpoints(ctx context.Context) ([]string, error)
- func (client *NginxClient) GetCaches(ctx context.Context) (*Caches, error)
- func (client *NginxClient) GetConnections(ctx context.Context) (*Connections, error)
- func (client *NginxClient) GetHTTPConnectionsLimit(ctx context.Context) (*HTTPLimitConnections, error)
- func (client *NginxClient) GetHTTPLimitReqs(ctx context.Context) (*HTTPLimitRequests, error)
- func (client *NginxClient) GetHTTPRequests(ctx context.Context) (*HTTPRequests, error)
- func (client *NginxClient) GetHTTPServers(ctx context.Context, upstream string) ([]UpstreamServer, error)
- func (client *NginxClient) GetKeyValPairs(ctx context.Context, zone string) (KeyValPairs, error)
- func (client *NginxClient) GetLocationZones(ctx context.Context) (*LocationZones, error)
- func (client *NginxClient) GetMaxAPIVersion(ctx context.Context) (int, error)
- func (client *NginxClient) GetNginxInfo(ctx context.Context) (*NginxInfo, error)
- func (client *NginxClient) GetNginxLicense(ctx context.Context) (*NginxLicense, error)
- func (client *NginxClient) GetProcesses(ctx context.Context) (*Processes, error)
- func (client *NginxClient) GetResolvers(ctx context.Context) (*Resolvers, error)
- func (client *NginxClient) GetSSL(ctx context.Context) (*SSL, error)
- func (client *NginxClient) GetServerZones(ctx context.Context) (*ServerZones, error)
- func (client *NginxClient) GetSlabs(ctx context.Context) (*Slabs, error)
- func (client *NginxClient) GetStats(ctx context.Context) (*Stats, error)
- func (client *NginxClient) GetStreamConnectionsLimit(ctx context.Context) (*StreamLimitConnections, error)
- func (client *NginxClient) GetStreamKeyValPairs(ctx context.Context, zone string) (KeyValPairs, error)
- func (client *NginxClient) GetStreamServerZones(ctx context.Context) (*StreamServerZones, error)
- func (client *NginxClient) GetStreamServers(ctx context.Context, upstream string) ([]StreamUpstreamServer, error)
- func (client *NginxClient) GetStreamUpstreams(ctx context.Context) (*StreamUpstreams, error)
- func (client *NginxClient) GetStreamZoneSync(ctx context.Context) (*StreamZoneSync, error)
- func (client *NginxClient) GetUpstreams(ctx context.Context) (*Upstreams, error)
- func (client *NginxClient) GetWorkers(ctx context.Context) ([]*Workers, error)
- func (client *NginxClient) ModifyKeyValPair(ctx context.Context, zone string, key string, val string) error
- func (client *NginxClient) ModifyStreamKeyValPair(ctx context.Context, zone string, key string, val string) error
- func (client *NginxClient) UpdateHTTPServer(ctx context.Context, upstream string, server UpstreamServer) error
- func (client *NginxClient) UpdateHTTPServers(ctx context.Context, upstream string, servers []UpstreamServer) (added []UpstreamServer, deleted []UpstreamServer, updated []UpstreamServer, ...)
- func (client *NginxClient) UpdateStreamServer(ctx context.Context, upstream string, server StreamUpstreamServer) error
- func (client *NginxClient) UpdateStreamServers(ctx context.Context, upstream string, servers []StreamUpstreamServer) (added []StreamUpstreamServer, deleted []StreamUpstreamServer, ...)
- func (client *NginxClient) Version() int
- type NginxInfo
- type NginxLicense
- type Option
- type Pages
- type Peer
- type Processes
- type Queue
- type Resolver
- type ResolverRequests
- type ResolverResponses
- type Resolvers
- type Responses
- type SSL
- type ServerZone
- type ServerZones
- type Sessions
- type Slab
- type Slabs
- type Slot
- type Slots
- type Stats
- type StreamLimitConnections
- type StreamPeer
- type StreamServerZone
- type StreamServerZones
- type StreamUpstream
- type StreamUpstreamServer
- type StreamUpstreams
- type StreamZoneSync
- type StreamZoneSyncStatus
- type SyncZone
- type Upstream
- type UpstreamServer
- type Upstreams
- type VerifyFailures
- type Workers
- type WorkersHTTP
Constants ¶
const (
// APIVersion is the default version of NGINX Plus API supported by the client.
APIVersion = 9
)
Variables ¶
var ( ErrParameterRequired = errors.New("parameter is required") ErrServerNotFound = errors.New("server not found") ErrServerExists = errors.New("server already exists") ErrNotSupported = errors.New("not supported") ErrInvalidTimeout = errors.New("invalid timeout") ErrPlusVersionNotFound = errors.New("plus version not found in the input string") )
Functions ¶
This section is empty.
Types ¶
type CacheStats ¶
CacheStats are basic cache stats.
type Connections ¶
Connections represents connection related stats.
type ExtendedCacheStats ¶
type ExtendedCacheStats struct { CacheStats ResponsesWritten uint64 `json:"responses_written"` BytesWritten uint64 `json:"bytes_written"` }
ExtendedCacheStats are extended cache stats.
type HTTPCache ¶
type HTTPCache struct { Size uint64 MaxSize uint64 `json:"max_size"` Cold bool Hit CacheStats Stale CacheStats Updating CacheStats Revalidated CacheStats Miss CacheStats Expired ExtendedCacheStats Bypass ExtendedCacheStats }
HTTPCache represents a zone's HTTP Cache.
type HTTPCodes ¶
type HTTPCodes struct { HTTPContinue uint64 `json:"100,omitempty"` HTTPSwitchingProtocols uint64 `json:"101,omitempty"` HTTPProcessing uint64 `json:"102,omitempty"` HTTPOk uint64 `json:"200,omitempty"` HTTPCreated uint64 `json:"201,omitempty"` HTTPAccepted uint64 `json:"202,omitempty"` HTTPNoContent uint64 `json:"204,omitempty"` HTTPPartialContent uint64 `json:"206,omitempty"` HTTPSpecialResponse uint64 `json:"300,omitempty"` HTTPMovedPermanently uint64 `json:"301,omitempty"` HTTPMovedTemporarily uint64 `json:"302,omitempty"` HTTPSeeOther uint64 `json:"303,omitempty"` HTTPNotModified uint64 `json:"304,omitempty"` HTTPTemporaryRedirect uint64 `json:"307,omitempty"` HTTPBadRequest uint64 `json:"400,omitempty"` HTTPForbidden uint64 `json:"403,omitempty"` HTTPNotFound uint64 `json:"404,omitempty"` HTTPNotAllowed uint64 `json:"405,omitempty"` HTTPRequestTimeOut uint64 `json:"408,omitempty"` HTTPConflict uint64 `json:"409,omitempty"` HTTPLengthRequired uint64 `json:"411,omitempty"` HTTPPreconditionFailed uint64 `json:"412,omitempty"` HTTPRequestEntityTooLarge uint64 `json:"413,omitempty"` HTTPRequestURITooLarge uint64 `json:"414,omitempty"` HTTPUnsupportedMediaType uint64 `json:"415,omitempty"` HTTPRangeNotSatisfiable uint64 `json:"416,omitempty"` HTTPTooManyRequests uint64 `json:"429,omitempty"` HTTPClose uint64 `json:"444,omitempty"` HTTPRequestHeaderTooLarge uint64 `json:"494,omitempty"` HTTPSCertError uint64 `json:"495,omitempty"` HTTPSNoCert uint64 `json:"496,omitempty"` HTTPToHTTPS uint64 `json:"497,omitempty"` HTTPClientClosedRequest uint64 `json:"499,omitempty"` HTTPInternalServerError uint64 `json:"500,omitempty"` HTTPNotImplemented uint64 `json:"501,omitempty"` HTTPBadGateway uint64 `json:"502,omitempty"` HTTPGatewayTimeOut uint64 `json:"504,omitempty"` HTTPInsufficientStorage uint64 `json:"507,omitempty"` }
HTTPCodes represents HTTP response codes.
type HTTPLimitConnections ¶
type HTTPLimitConnections map[string]LimitConnection
HTTPLimitConnections represents limit connections related stats.
type HTTPLimitRequest ¶
type HTTPLimitRequest struct { Passed uint64 Delayed uint64 Rejected uint64 DelayedDryRun uint64 `json:"delayed_dry_run"` RejectedDryRun uint64 `json:"rejected_dry_run"` }
HTTPLimitRequest represents HTTP Requests Rate Limiting.
type HTTPLimitRequests ¶
type HTTPLimitRequests map[string]HTTPLimitRequest
HTTPLimitRequests represents limit requests related stats.
type HTTPRequests ¶
HTTPRequests represents HTTP request related stats.
type HealthChecks ¶
type HealthChecks struct { Checks uint64 Fails uint64 Unhealthy uint64 LastPassed bool `json:"last_passed"` }
HealthChecks represents health check related stats for a peer.
type KeyValPairs ¶
KeyValPairs are the key-value pairs stored in a zone.
type KeyValPairsByZone ¶
type KeyValPairsByZone map[string]KeyValPairs
KeyValPairsByZone are the KeyValPairs for all zones, by zone name.
type LicenseReporting ¶ added in v2.1.0
LicenseReporting contains information about license status for NGINX Plus.
type LimitConnection ¶
type LimitConnection struct { Passed uint64 Rejected uint64 RejectedDryRun uint64 `json:"rejected_dry_run"` }
LimitConnection represents Connections Limiting.
type LocationZone ¶
type LocationZone struct { Requests int64 Responses Responses Discarded int64 Received int64 Sent int64 }
LocationZone represents location_zones related stats.
type LocationZones ¶
type LocationZones map[string]LocationZone
LocationZones represents location_zones related stats.
type NginxClient ¶
type NginxClient struct {
// contains filtered or unexported fields
}
NginxClient lets you access NGINX Plus API.
func NewNginxClient ¶
func NewNginxClient(apiEndpoint string, opts ...Option) (*NginxClient, error)
NewNginxClient creates a new NginxClient.
func (*NginxClient) AddHTTPServer ¶
func (client *NginxClient) AddHTTPServer(ctx context.Context, upstream string, server UpstreamServer) error
AddHTTPServer adds the server to the upstream.
func (*NginxClient) AddKeyValPair ¶
func (client *NginxClient) AddKeyValPair(ctx context.Context, zone string, key string, val string) error
AddKeyValPair adds a new key/value pair to a given HTTP zone.
func (*NginxClient) AddStreamKeyValPair ¶
func (client *NginxClient) AddStreamKeyValPair(ctx context.Context, zone string, key string, val string) error
AddStreamKeyValPair adds a new key/value pair to a given Stream zone.
func (*NginxClient) AddStreamServer ¶
func (client *NginxClient) AddStreamServer(ctx context.Context, upstream string, server StreamUpstreamServer) error
AddStreamServer adds the stream server to the upstream.
func (*NginxClient) CheckIfStreamUpstreamExists ¶
func (client *NginxClient) CheckIfStreamUpstreamExists(ctx context.Context, upstream string) error
CheckIfStreamUpstreamExists checks if the stream upstream exists in NGINX. If the upstream doesn't exist, it returns the error.
func (*NginxClient) CheckIfUpstreamExists ¶
func (client *NginxClient) CheckIfUpstreamExists(ctx context.Context, upstream string) error
CheckIfUpstreamExists checks if the upstream exists in NGINX. If the upstream doesn't exist, it returns the error.
func (*NginxClient) DeleteHTTPServer ¶
func (client *NginxClient) DeleteHTTPServer(ctx context.Context, upstream string, server string) error
DeleteHTTPServer the server from the upstream.
func (*NginxClient) DeleteKeyValPairs ¶
func (client *NginxClient) DeleteKeyValPairs(ctx context.Context, zone string) error
DeleteKeyValPairs deletes all the key-value pairs in a given HTTP zone.
func (*NginxClient) DeleteKeyValuePair ¶
DeleteKeyValuePair deletes the key/value pair for a key in a given HTTP zone.
func (*NginxClient) DeleteStreamKeyValPairs ¶
func (client *NginxClient) DeleteStreamKeyValPairs(ctx context.Context, zone string) error
DeleteStreamKeyValPairs deletes all the key-value pairs in a given Stream zone.
func (*NginxClient) DeleteStreamKeyValuePair ¶
func (client *NginxClient) DeleteStreamKeyValuePair(ctx context.Context, zone string, key string) error
DeleteStreamKeyValuePair deletes the key/value pair for a key in a given Stream zone.
func (*NginxClient) DeleteStreamServer ¶
func (client *NginxClient) DeleteStreamServer(ctx context.Context, upstream string, server string) error
DeleteStreamServer the server from the upstream.
func (*NginxClient) GetAllKeyValPairs ¶
func (client *NginxClient) GetAllKeyValPairs(ctx context.Context) (KeyValPairsByZone, error)
GetAllKeyValPairs fetches all key/value pairs for all HTTP zones.
func (*NginxClient) GetAllStreamKeyValPairs ¶
func (client *NginxClient) GetAllStreamKeyValPairs(ctx context.Context) (KeyValPairsByZone, error)
GetAllStreamKeyValPairs fetches all key/value pairs for all Stream zones.
func (*NginxClient) GetAvailableEndpoints ¶
func (client *NginxClient) GetAvailableEndpoints(ctx context.Context) ([]string, error)
GetAvailableEndpoints returns available endpoints in the API.
func (*NginxClient) GetAvailableStreamEndpoints ¶
func (client *NginxClient) GetAvailableStreamEndpoints(ctx context.Context) ([]string, error)
GetAvailableStreamEndpoints returns available stream endpoints in the API with a context.
func (*NginxClient) GetCaches ¶
func (client *NginxClient) GetCaches(ctx context.Context) (*Caches, error)
GetCaches returns Cache stats with a context.
func (*NginxClient) GetConnections ¶
func (client *NginxClient) GetConnections(ctx context.Context) (*Connections, error)
GetConnections returns Connections stats with a context.
func (*NginxClient) GetHTTPConnectionsLimit ¶
func (client *NginxClient) GetHTTPConnectionsLimit(ctx context.Context) (*HTTPLimitConnections, error)
GetHTTPConnectionsLimit returns http/limit_conns stats with a context.
func (*NginxClient) GetHTTPLimitReqs ¶
func (client *NginxClient) GetHTTPLimitReqs(ctx context.Context) (*HTTPLimitRequests, error)
GetHTTPLimitReqs returns http/limit_reqs stats with a context.
func (*NginxClient) GetHTTPRequests ¶
func (client *NginxClient) GetHTTPRequests(ctx context.Context) (*HTTPRequests, error)
GetHTTPRequests returns http/requests stats with a context.
func (*NginxClient) GetHTTPServers ¶
func (client *NginxClient) GetHTTPServers(ctx context.Context, upstream string) ([]UpstreamServer, error)
GetHTTPServers returns the servers of the upstream from NGINX.
func (*NginxClient) GetKeyValPairs ¶
func (client *NginxClient) GetKeyValPairs(ctx context.Context, zone string) (KeyValPairs, error)
GetKeyValPairs fetches key/value pairs for a given HTTP zone.
func (*NginxClient) GetLocationZones ¶
func (client *NginxClient) GetLocationZones(ctx context.Context) (*LocationZones, error)
GetLocationZones returns http/location_zones stats with a context.
func (*NginxClient) GetMaxAPIVersion ¶
func (client *NginxClient) GetMaxAPIVersion(ctx context.Context) (int, error)
GetMaxAPIVersion returns the maximum API version supported by the server and the client.
func (*NginxClient) GetNginxInfo ¶
func (client *NginxClient) GetNginxInfo(ctx context.Context) (*NginxInfo, error)
GetNginxInfo returns Nginx stats with a context.
func (*NginxClient) GetNginxLicense ¶ added in v2.1.0
func (client *NginxClient) GetNginxLicense(ctx context.Context) (*NginxLicense, error)
GetNginxLicense returns Nginx License data with a context.
func (*NginxClient) GetProcesses ¶
func (client *NginxClient) GetProcesses(ctx context.Context) (*Processes, error)
GetProcesses returns Processes stats with a context.
func (*NginxClient) GetResolvers ¶
func (client *NginxClient) GetResolvers(ctx context.Context) (*Resolvers, error)
GetResolvers returns Resolvers stats with a context.
func (*NginxClient) GetSSL ¶
func (client *NginxClient) GetSSL(ctx context.Context) (*SSL, error)
GetSSL returns SSL stats with a context.
func (*NginxClient) GetServerZones ¶
func (client *NginxClient) GetServerZones(ctx context.Context) (*ServerZones, error)
GetServerZones returns http/server_zones stats with a context.
func (*NginxClient) GetSlabs ¶
func (client *NginxClient) GetSlabs(ctx context.Context) (*Slabs, error)
GetSlabs returns Slabs stats with a context.
func (*NginxClient) GetStats ¶
func (client *NginxClient) GetStats(ctx context.Context) (*Stats, error)
GetStats gets process, slab, connection, request, ssl, zone, stream zone, upstream and stream upstream related stats from the NGINX Plus API.
func (*NginxClient) GetStreamConnectionsLimit ¶
func (client *NginxClient) GetStreamConnectionsLimit(ctx context.Context) (*StreamLimitConnections, error)
GetStreamConnectionsLimit returns stream/limit_conns stats with a context.
func (*NginxClient) GetStreamKeyValPairs ¶
func (client *NginxClient) GetStreamKeyValPairs(ctx context.Context, zone string) (KeyValPairs, error)
GetStreamKeyValPairs fetches key/value pairs for a given Stream zone.
func (*NginxClient) GetStreamServerZones ¶
func (client *NginxClient) GetStreamServerZones(ctx context.Context) (*StreamServerZones, error)
GetStreamServerZones returns stream/server_zones stats with a context.
func (*NginxClient) GetStreamServers ¶
func (client *NginxClient) GetStreamServers(ctx context.Context, upstream string) ([]StreamUpstreamServer, error)
GetStreamServers returns the stream servers of the upstream from NGINX.
func (*NginxClient) GetStreamUpstreams ¶
func (client *NginxClient) GetStreamUpstreams(ctx context.Context) (*StreamUpstreams, error)
GetStreamUpstreams returns stream/upstreams stats with a context.
func (*NginxClient) GetStreamZoneSync ¶
func (client *NginxClient) GetStreamZoneSync(ctx context.Context) (*StreamZoneSync, error)
GetStreamZoneSync returns stream/zone_sync stats with a context.
func (*NginxClient) GetUpstreams ¶
func (client *NginxClient) GetUpstreams(ctx context.Context) (*Upstreams, error)
GetUpstreams returns http/upstreams stats with a context.
func (*NginxClient) GetWorkers ¶
func (client *NginxClient) GetWorkers(ctx context.Context) ([]*Workers, error)
GetWorkers returns workers stats.
func (*NginxClient) ModifyKeyValPair ¶
func (client *NginxClient) ModifyKeyValPair(ctx context.Context, zone string, key string, val string) error
ModifyKeyValPair modifies the value of an existing key in a given HTTP zone.
func (*NginxClient) ModifyStreamKeyValPair ¶
func (client *NginxClient) ModifyStreamKeyValPair(ctx context.Context, zone string, key string, val string) error
ModifyStreamKeyValPair modifies the value of an existing key in a given Stream zone.
func (*NginxClient) UpdateHTTPServer ¶
func (client *NginxClient) UpdateHTTPServer(ctx context.Context, upstream string, server UpstreamServer) error
UpdateHTTPServer updates the server of the upstream.
func (*NginxClient) UpdateHTTPServers ¶
func (client *NginxClient) UpdateHTTPServers(ctx context.Context, upstream string, servers []UpstreamServer) (added []UpstreamServer, deleted []UpstreamServer, updated []UpstreamServer, err error)
UpdateHTTPServers updates the servers of the upstream. Servers that are in the slice, but don't exist in NGINX will be added to NGINX. Servers that aren't in the slice, but exist in NGINX, will be removed from NGINX. Servers that are in the slice and exist in NGINX, but have different parameters, will be updated.
func (*NginxClient) UpdateStreamServer ¶
func (client *NginxClient) UpdateStreamServer(ctx context.Context, upstream string, server StreamUpstreamServer) error
UpdateStreamServer updates the stream server of the upstream.
func (*NginxClient) UpdateStreamServers ¶
func (client *NginxClient) UpdateStreamServers(ctx context.Context, upstream string, servers []StreamUpstreamServer) (added []StreamUpstreamServer, deleted []StreamUpstreamServer, updated []StreamUpstreamServer, err error)
UpdateStreamServers updates the servers of the upstream. Servers that are in the slice, but don't exist in NGINX will be added to NGINX. Servers that aren't in the slice, but exist in NGINX, will be removed from NGINX. Servers that are in the slice and exist in NGINX, but have different parameters, will be updated.
func (*NginxClient) Version ¶
func (client *NginxClient) Version() int
Version returns client's current N+ API version.
type NginxInfo ¶
type NginxInfo struct { Version string Build string Address string LoadTimestamp string `json:"load_timestamp"` Timestamp string Generation uint64 ProcessID uint64 `json:"pid"` ParentProcessID uint64 `json:"ppid"` }
NginxInfo contains general information about NGINX Plus.
type NginxLicense ¶ added in v2.1.0
type NginxLicense struct { ActiveTill uint64 `json:"active_till"` Eval bool Reporting LicenseReporting }
NginxLicense contains licensing information about NGINX Plus.
type Option ¶
type Option func(*NginxClient)
func WithAPIVersion ¶
WithAPIVersion sets the API version to use for accessing the API.
func WithCheckAPI ¶
func WithCheckAPI() Option
WithCheckAPI sets the flag to check the API version of the server.
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client to use for accessing the API.
func WithMaxAPIVersion ¶
func WithMaxAPIVersion() Option
WithMaxAPIVersion sets the API version to the max API version.
type Peer ¶
type Peer struct { Server string Service string Name string Selected string Downstart string State string Responses Responses SSL SSL HealthChecks HealthChecks `json:"health_checks"` Requests uint64 ID int MaxConns int `json:"max_conns"` Sent uint64 Received uint64 Fails uint64 Active uint64 Downtime uint64 Weight int HeaderTime uint64 `json:"header_time"` ResponseTime uint64 `json:"response_time"` Backup bool }
Peer represents peer (upstream server) related stats.
type Processes ¶
type Processes struct {
Respawned int64
}
Processes represents processes related stats.
type Resolver ¶
type Resolver struct { Requests ResolverRequests `json:"requests"` Responses ResolverResponses `json:"responses"` }
Resolver represents resolvers related stats.
type ResolverRequests ¶
ResolverRequests represents resolver requests.
type ResolverResponses ¶
type ResolverResponses struct { Noerror int64 Formerr int64 Servfail int64 Nxdomain int64 Notimp int64 Refused int64 Timedout int64 Unknown int64 }
ResolverResponses represents resolver responses.
type Responses ¶
type Responses struct { Codes HTTPCodes Responses1xx uint64 `json:"1xx"` Responses2xx uint64 `json:"2xx"` Responses3xx uint64 `json:"3xx"` Responses4xx uint64 `json:"4xx"` Responses5xx uint64 `json:"5xx"` Total uint64 }
Responses represents HTTP response related stats.
type SSL ¶
type SSL struct { Handshakes uint64 HandshakesFailed uint64 `json:"handshakes_failed"` SessionReuses uint64 `json:"session_reuses"` NoCommonProtocol uint64 `json:"no_common_protocol"` NoCommonCipher uint64 `json:"no_common_cipher"` HandshakeTimeout uint64 `json:"handshake_timeout"` PeerRejectedCert uint64 `json:"peer_rejected_cert"` VerifyFailures VerifyFailures `json:"verify_failures"` }
SSL represents SSL related stats.
type ServerZone ¶
type ServerZone struct { Processing uint64 Requests uint64 Responses Responses Discarded uint64 Received uint64 Sent uint64 SSL SSL }
ServerZone represents server zone related stats.
type ServerZones ¶
type ServerZones map[string]ServerZone
ServerZones is map of server zone stats by zone name.
type Sessions ¶
type Sessions struct { Sessions2xx uint64 `json:"2xx"` Sessions4xx uint64 `json:"4xx"` Sessions5xx uint64 `json:"5xx"` Total uint64 }
Sessions represents stream session related stats.
type Stats ¶
type Stats struct { Upstreams Upstreams ServerZones ServerZones StreamServerZones StreamServerZones StreamUpstreams StreamUpstreams Slabs Slabs Caches Caches HTTPLimitConnections HTTPLimitConnections StreamLimitConnections StreamLimitConnections HTTPLimitRequests HTTPLimitRequests Resolvers Resolvers LocationZones LocationZones StreamZoneSync *StreamZoneSync Workers []*Workers NginxInfo NginxInfo SSL SSL Connections Connections HTTPRequests HTTPRequests Processes Processes }
Stats represents NGINX Plus stats fetched from the NGINX Plus API. https://nginx.org/en/docs/http/ngx_http_api_module.html
type StreamLimitConnections ¶
type StreamLimitConnections map[string]LimitConnection
StreamLimitConnections represents limit connections related stats.
type StreamPeer ¶
type StreamPeer struct { Server string Service string Name string Selected string Downstart string State string SSL SSL HealthChecks HealthChecks `json:"health_checks"` Connections uint64 Received uint64 ID int ConnectTime int `json:"connect_time"` FirstByteTime int `json:"first_byte_time"` ResponseTime uint64 `json:"response_time"` Sent uint64 MaxConns int `json:"max_conns"` Fails uint64 Active uint64 Downtime uint64 Weight int Backup bool }
StreamPeer represents peer (stream upstream server) related stats.
type StreamServerZone ¶
type StreamServerZone struct { Processing uint64 Connections uint64 Sessions Sessions Discarded uint64 Received uint64 Sent uint64 SSL SSL }
StreamServerZone represents stream server zone related stats.
type StreamServerZones ¶
type StreamServerZones map[string]StreamServerZone
StreamServerZones is map of stream server zone stats by zone name.
type StreamUpstream ¶
type StreamUpstream struct { Zone string Peers []StreamPeer Zombies int }
StreamUpstream represents stream upstream related stats.
type StreamUpstreamServer ¶
type StreamUpstreamServer struct { MaxConns *int `json:"max_conns,omitempty"` MaxFails *int `json:"max_fails,omitempty"` Backup *bool `json:"backup,omitempty"` Down *bool `json:"down,omitempty"` Weight *int `json:"weight,omitempty"` Server string `json:"server"` FailTimeout string `json:"fail_timeout,omitempty"` SlowStart string `json:"slow_start,omitempty"` Service string `json:"service,omitempty"` ID int `json:"id,omitempty"` }
StreamUpstreamServer lets you configure Stream upstreams.
type StreamUpstreams ¶
type StreamUpstreams map[string]StreamUpstream
StreamUpstreams is a map of stream upstream stats by upstream name.
type StreamZoneSync ¶
type StreamZoneSync struct { Zones map[string]SyncZone Status StreamZoneSyncStatus }
StreamZoneSync represents the sync information per each shared memory zone and the sync information per node in a cluster.
type StreamZoneSyncStatus ¶
type StreamZoneSyncStatus struct { BytesIn uint64 `json:"bytes_in"` MsgsIn uint64 `json:"msgs_in"` MsgsOut uint64 `json:"msgs_out"` BytesOut uint64 `json:"bytes_out"` NodesOnline uint64 `json:"nodes_online"` }
StreamZoneSyncStatus represents the status of a shared memory zone.
type SyncZone ¶
type SyncZone struct { RecordsPending uint64 `json:"records_pending"` RecordsTotal uint64 `json:"records_total"` }
SyncZone represents the synchronization status of a shared memory zone.
type UpstreamServer ¶
type UpstreamServer struct { MaxConns *int `json:"max_conns,omitempty"` MaxFails *int `json:"max_fails,omitempty"` Backup *bool `json:"backup,omitempty"` Down *bool `json:"down,omitempty"` Weight *int `json:"weight,omitempty"` Server string `json:"server"` FailTimeout string `json:"fail_timeout,omitempty"` SlowStart string `json:"slow_start,omitempty"` Route string `json:"route,omitempty"` Service string `json:"service,omitempty"` ID int `json:"id,omitempty"` Drain bool `json:"drain,omitempty"` }
UpstreamServer lets you configure HTTP upstreams.
type VerifyFailures ¶
type Workers ¶
type Workers struct { ID int ProcessID uint64 `json:"pid"` HTTP WorkersHTTP `json:"http"` Connections Connections }
Workers represents worker connections related stats.
type WorkersHTTP ¶
type WorkersHTTP struct {
HTTPRequests HTTPRequests `json:"requests"`
}
WorkersHTTP represents HTTP worker connections.