Versions in this module Expand all Collapse all v2 v2.1.0 Nov 25, 2024 Changes in this version + var ErrPlusVersionNotFound = errors.New("plus version not found in the input string") + type LicenseReporting struct + Fails uint64 + Grace uint64 + Healthy bool type NginxClient + func (client *NginxClient) GetNginxLicense(ctx context.Context) (*NginxLicense, error) + type NginxLicense struct + ActiveTill uint64 + Eval bool + Reporting LicenseReporting v2.0.1 Sep 24, 2024 Changes in this version + const APIVersion + var ErrInvalidTimeout = errors.New("invalid timeout") + var ErrNotSupported = errors.New("not supported") + var ErrParameterRequired = errors.New("parameter is required") + var ErrServerExists = errors.New("server already exists") + var ErrServerNotFound = errors.New("server not found") + type CacheStats struct + Bytes uint64 + Responses uint64 + type Caches = map[string]HTTPCache + type Connections struct + Accepted uint64 + Active uint64 + Dropped uint64 + Idle uint64 + type ExtendedCacheStats struct + BytesWritten uint64 + ResponsesWritten uint64 + type HTTPCache struct + Bypass ExtendedCacheStats + Cold bool + Expired ExtendedCacheStats + Hit CacheStats + MaxSize uint64 + Miss CacheStats + Revalidated CacheStats + Size uint64 + Stale CacheStats + Updating CacheStats + type HTTPCodes struct + HTTPAccepted uint64 + HTTPBadGateway uint64 + HTTPBadRequest uint64 + HTTPClientClosedRequest uint64 + HTTPClose uint64 + HTTPConflict uint64 + HTTPContinue uint64 + HTTPCreated uint64 + HTTPForbidden uint64 + HTTPGatewayTimeOut uint64 + HTTPInsufficientStorage uint64 + HTTPInternalServerError uint64 + HTTPLengthRequired uint64 + HTTPMovedPermanently uint64 + HTTPMovedTemporarily uint64 + HTTPNoContent uint64 + HTTPNotAllowed uint64 + HTTPNotFound uint64 + HTTPNotImplemented uint64 + HTTPNotModified uint64 + HTTPOk uint64 + HTTPPartialContent uint64 + HTTPPreconditionFailed uint64 + HTTPProcessing uint64 + HTTPRangeNotSatisfiable uint64 + HTTPRequestEntityTooLarge uint64 + HTTPRequestHeaderTooLarge uint64 + HTTPRequestTimeOut uint64 + HTTPRequestURITooLarge uint64 + HTTPSCertError uint64 + HTTPSNoCert uint64 + HTTPSeeOther uint64 + HTTPServiceUnavailable uint64 + HTTPSpecialResponse uint64 + HTTPSwitchingProtocols uint64 + HTTPTemporaryRedirect uint64 + HTTPToHTTPS uint64 + HTTPTooManyRequests uint64 + HTTPUnauthorized uint64 + HTTPUnsupportedMediaType uint64 + type HTTPLimitConnections map[string]LimitConnection + type HTTPLimitRequest struct + Delayed uint64 + DelayedDryRun uint64 + Passed uint64 + Rejected uint64 + RejectedDryRun uint64 + type HTTPLimitRequests map[string]HTTPLimitRequest + type HTTPRequests struct + Current uint64 + Total uint64 + type HealthChecks struct + Checks uint64 + Fails uint64 + LastPassed bool + Unhealthy uint64 + type KeyValPairs map[string]string + type KeyValPairsByZone map[string]KeyValPairs + type LimitConnection struct + Passed uint64 + Rejected uint64 + RejectedDryRun uint64 + type LocationZone struct + Discarded int64 + Received int64 + Requests int64 + Responses Responses + Sent int64 + type LocationZones map[string]LocationZone + type NginxClient struct + func NewNginxClient(apiEndpoint string, opts ...Option) (*NginxClient, error) + 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) 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 struct + Address string + Build string + Generation uint64 + LoadTimestamp string + ParentProcessID uint64 + ProcessID uint64 + Timestamp string + Version string + type Option func(*NginxClient) + func WithAPIVersion(apiVersion int) Option + func WithCheckAPI() Option + func WithHTTPClient(httpClient *http.Client) Option + func WithMaxAPIVersion() Option + type Pages struct + Free uint64 + Used uint64 + type Peer struct + Active uint64 + Backup bool + Downstart string + Downtime uint64 + Fails uint64 + HeaderTime uint64 + HealthChecks HealthChecks + ID int + MaxConns int + Name string + Received uint64 + Requests uint64 + ResponseTime uint64 + Responses Responses + SSL SSL + Selected string + Sent uint64 + Server string + Service string + State string + Unavail uint64 + Weight int + type Processes struct + Respawned int64 + type Queue struct + MaxSize int + Overflows uint64 + Size int + type Resolver struct + Requests ResolverRequests + Responses ResolverResponses + type ResolverRequests struct + Addr int64 + Name int64 + Srv int64 + type ResolverResponses struct + Formerr int64 + Noerror int64 + Notimp int64 + Nxdomain int64 + Refused int64 + Servfail int64 + Timedout int64 + Unknown int64 + type Resolvers map[string]Resolver + type Responses struct + Codes HTTPCodes + Responses1xx uint64 + Responses2xx uint64 + Responses3xx uint64 + Responses4xx uint64 + Responses5xx uint64 + Total uint64 + type SSL struct + HandshakeTimeout uint64 + Handshakes uint64 + HandshakesFailed uint64 + NoCommonCipher uint64 + NoCommonProtocol uint64 + PeerRejectedCert uint64 + SessionReuses uint64 + VerifyFailures VerifyFailures + type ServerZone struct + Discarded uint64 + Processing uint64 + Received uint64 + Requests uint64 + Responses Responses + SSL SSL + Sent uint64 + type ServerZones map[string]ServerZone + type Sessions struct + Sessions2xx uint64 + Sessions4xx uint64 + Sessions5xx uint64 + Total uint64 + type Slab struct + Pages Pages + Slots Slots + type Slabs map[string]Slab + type Slot struct + Fails uint64 + Free uint64 + Reqs uint64 + Used uint64 + type Slots map[string]Slot + type Stats struct + Caches Caches + Connections Connections + HTTPLimitConnections HTTPLimitConnections + HTTPLimitRequests HTTPLimitRequests + HTTPRequests HTTPRequests + LocationZones LocationZones + NginxInfo NginxInfo + Processes Processes + Resolvers Resolvers + SSL SSL + ServerZones ServerZones + Slabs Slabs + StreamLimitConnections StreamLimitConnections + StreamServerZones StreamServerZones + StreamUpstreams StreamUpstreams + StreamZoneSync *StreamZoneSync + Upstreams Upstreams + Workers []*Workers + type StreamLimitConnections map[string]LimitConnection + type StreamPeer struct + Active uint64 + Backup bool + ConnectTime int + Connections uint64 + Downstart string + Downtime uint64 + Fails uint64 + FirstByteTime int + HealthChecks HealthChecks + ID int + MaxConns int + Name string + Received uint64 + ResponseTime uint64 + SSL SSL + Selected string + Sent uint64 + Server string + Service string + State string + Unavail uint64 + Weight int + type StreamServerZone struct + Connections uint64 + Discarded uint64 + Processing uint64 + Received uint64 + SSL SSL + Sent uint64 + Sessions Sessions + type StreamServerZones map[string]StreamServerZone + type StreamUpstream struct + Peers []StreamPeer + Zombies int + Zone string + type StreamUpstreamServer struct + Backup *bool + Down *bool + FailTimeout string + ID int + MaxConns *int + MaxFails *int + Server string + Service string + SlowStart string + Weight *int + type StreamUpstreams map[string]StreamUpstream + type StreamZoneSync struct + Status StreamZoneSyncStatus + Zones map[string]SyncZone + type StreamZoneSyncStatus struct + BytesIn uint64 + BytesOut uint64 + MsgsIn uint64 + MsgsOut uint64 + NodesOnline uint64 + type SyncZone struct + RecordsPending uint64 + RecordsTotal uint64 + type Upstream struct + Keepalive int + Peers []Peer + Queue Queue + Zombies int + Zone string + type UpstreamServer struct + Backup *bool + Down *bool + Drain bool + FailTimeout string + ID int + MaxConns *int + MaxFails *int + Route string + Server string + Service string + SlowStart string + Weight *int + type Upstreams map[string]Upstream + type VerifyFailures struct + ExpiredCert uint64 + HostnameMismatch uint64 + NoCert uint64 + Other uint64 + RevokedCert uint64 + type Workers struct + Connections Connections + HTTP WorkersHTTP + ID int + ProcessID uint64 + type WorkersHTTP struct + HTTPRequests HTTPRequests Other modules containing this package github.com/nginxinc/nginx-plus-go-client