Versions in this module Expand all Collapse all v0 v0.1.1 Dec 27, 2024 v0.1.0 Dec 13, 2024 Changes in this version + const ConnAll + const ConnClosed + const ConnOpen + const DefaultRequestTimeout + const DefaultStall + var ErrInvalidServerID = errors.New("sever with given ID does not exist") + var ErrPingResponse = errors.New("error receiving ping response") + var ErrRequest = errors.New("error sending API request") + var ErrValidation = errors.New("validation error") + type APIError struct + Code int + Description string + ErrCode uint16 + type AccountDetail struct + Id string + Name string + Streams []StreamDetail + type ClusterOptsVarz struct + AuthTimeout float64 + Host string + Name string + PoolSize int + Port int + TLSRequired bool + TLSTimeout float64 + TLSVerify bool + URLs []string + type ConnInfo struct + Account string + AuthorizedUser string + Cid uint64 + IP string + Idle string + InBytes int64 + InMsgs int64 + IssuerKey string + JWT string + Kind string + Lang string + LastActivity time.Time + MQTTClient string + Name string + NameTag string + NumSubs uint32 + OutBytes int64 + OutMsgs int64 + Pending int + Port int + RTT string + Reason string + Start time.Time + Stop *time.Time + Subs []string + SubsDetail []SubDetail + TLSCipher string + TLSFirst bool + TLSPeerCerts []*TLSPeerCert + TLSVersion string + Tags jwt.TagList + Type string + Uptime string + Version string + type ConnState int + type Connz struct + Conns []*ConnInfo + ID string + Limit int + Now time.Time + NumConns int + Offset int + Total int + type ConnzEventOptions struct + type ConnzOptions struct + Account string + CID uint64 + FilterSubject string + Limit int + MQTTClient string + Offset int + Sort SortOpt + State ConnState + Subscriptions bool + SubscriptionsDetail bool + User string + Username bool + type ConnzResp struct + Connz Connz + Error APIError + Server ServerInfo + type DataStats struct + Bytes int64 + Msgs int64 + type DenyRules struct + Exports []string + Imports []string + type EventFilterOptions struct + Cluster string + Domain string + Host string + Name string + Tags []string + type GatewayOptsVarz struct + Advertise string + AuthTimeout float64 + ConnectRetries int + Gateways []RemoteGatewayOptsVarz + Host string + Name string + Port int + RejectUnknown bool + TLSRequired bool + TLSTimeout float64 + TLSVerify bool + type GatewayStat struct + ID uint64 + Name string + NumInbound int + Received DataStats + Sent DataStats + type HealthZErrorType int + const HealthzErrorAccount + const HealthzErrorBadRequest + const HealthzErrorConn + const HealthzErrorConsumer + const HealthzErrorJetStream + const HealthzErrorStream + type Healthz struct + Error string + Errors []HealthzError + Status string + StatusCode int + type HealthzError struct + Account string + Consumer string + Error string + Stream string + Type HealthZErrorType + type HealthzOptions struct + Account string + Consumer string + Details bool + JSEnabledOnly bool + JSServerOnly bool + Stream string + type HealthzResp struct + Error APIError + Healthz Healthz + Server ServerInfo + type JSInfo struct + AccountDetails []*AccountDetail + Bytes uint64 + Config JetStreamConfig + Consumers int + Disabled bool + ID string + Messages uint64 + Meta *MetaClusterInfo + Now time.Time + Streams int + type JSZResp struct + Error APIError + JSInfo JSInfo + Server ServerInfo + type JetStreamAPIStats struct + Errors uint64 + Inflight uint64 + Total uint64 + type JetStreamConfig struct + CompressOK bool + Domain string + MaxMemory int64 + MaxStore int64 + StoreDir string + SyncAlways bool + SyncInterval time.Duration + UniqueTag string + type JetStreamStats struct + API JetStreamAPIStats + Accounts int + HAAssets int + Memory uint64 + ReservedMemory uint64 + ReservedStore uint64 + Store uint64 + type JetStreamVarz struct + Config *JetStreamConfig + Meta *MetaClusterInfo + Stats *JetStreamStats + type JszEventOptions struct + type JszOptions struct + Account string + Accounts bool + Config bool + Consumer bool + LeaderOnly bool + Limit int + Offset int + RaftGroups bool + StreamLeaderOnly bool + Streams bool + type LeafNodeOptsVarz struct + AuthTimeout float64 + Host string + Port int + Remotes []RemoteLeafOptsVarz + TLSOCSPPeerVerify bool + TLSRequired bool + TLSTimeout float64 + TLSVerify bool + type MQTTOptsVarz struct + AckWait time.Duration + AuthTimeout float64 + Host string + JsDomain string + MaxAckPending uint16 + NoAuthUser string + Port int + TLSMap bool + TLSOCSPPeerVerify bool + TLSPinnedCerts []string + TLSTimeout float64 + type MetaClusterInfo struct + Leader string + Name string + Peer string + Pending int + Replicas []*PeerInfo + Size int + type OCSPResponseCacheVarz struct + Goods int64 + Hits int64 + Misses int64 + Responses int64 + Revokes int64 + Type string + Unknowns int64 + type PeerInfo struct + Active time.Duration + Current bool + Lag uint64 + Name string + Offline bool + Peer string + type RaftGroupDetail struct + Name string + RaftGroup string + type RemoteGatewayOptsVarz struct + Name string + TLSTimeout float64 + URLs []string + type RemoteLeafOptsVarz struct + Deny *DenyRules + LocalAccount string + TLSOCSPPeerVerify bool + TLSTimeout float64 + URLs []string + type RouteStat struct + ID uint64 + Name string + Pending int + Received DataStats + Sent DataStats + type ServerInfo struct + Cluster string + Domain string + Host string + ID string + JetStream bool + Name string + Seq uint64 + Tags []string + Time time.Time + Version string + type ServerStats struct + ActiveAccounts int + ActiveServers int + CPU float64 + Connections int + Cores int + Gateways []*GatewayStat + JetStream *JetStreamVarz + Mem int64 + NumSubs uint32 + Received DataStats + Routes []*RouteStat + Sent DataStats + SlowConsumers int64 + Start time.Time + TotalConnections uint64 + type ServerStatszResp struct + Error APIError + Server ServerInfo + Statsz ServerStats + type SlowConsumersStats struct + Clients uint64 + Gateways uint64 + Leafs uint64 + Routes uint64 + type SortOpt string + const ByCid + const ByIdle + const ByInBytes + const ByInMsgs + const ByLast + const ByOutBytes + const ByOutMsgs + const ByPending + const ByReason + const ByStart + const ByStop + const BySubs + const ByUptime + type StatszEventOptions struct + type StreamDetail struct + Cluster *nats.ClusterInfo + Config *nats.StreamConfig + Consumer []*nats.ConsumerInfo + ConsumerRaftGroups []*RaftGroupDetail + Created time.Time + Mirror *nats.StreamSourceInfo + Name string + RaftGroup string + Sources []*nats.StreamSourceInfo + State nats.StreamState + type SubDetail struct + Account string + Cid uint64 + Max int64 + Msgs int64 + Queue string + Sid string + Subject string + type SublistStats struct + AvgFanout float64 + CacheHitRate float64 + MaxFanout uint32 + NumCache uint32 + NumInserts uint64 + NumMatches uint64 + NumRemoves uint64 + NumSubs uint32 + type Subsz struct + ID string + Limit int + Now time.Time + Offset int + Subs []SubDetail + Total int + type SubszOptions struct + Account string + Limit int + Offset int + Subscriptions bool + Test string + type SubszResp struct + Error APIError + Server ServerInfo + Subsz Subsz + type SysClientOpt func(*sysClientOpts) error + func ServerCount(count int) SysClientOpt + func StallTimer(initialTimeout, interval time.Duration) SysClientOpt + type System struct + func NewSysClient(nc *nats.Conn, opts ...SysClientOpt) (*System, error) + func (s *System) Connz(ctx context.Context, id string, opts ConnzEventOptions) (*ConnzResp, error) + func (s *System) ConnzPing(ctx context.Context, opts ConnzEventOptions) ([]ConnzResp, error) + func (s *System) Healthz(ctx context.Context, id string, opts HealthzOptions) (*HealthzResp, error) + func (s *System) HealthzPing(ctx context.Context, opts HealthzOptions) ([]HealthzResp, error) + func (s *System) Jsz(ctx context.Context, id string, opts JszEventOptions) (*JSZResp, error) + func (s *System) JszPing(ctx context.Context, opts JszEventOptions) ([]JSZResp, error) + func (s *System) ServerStatsz(ctx context.Context, id string, opts StatszEventOptions) (*ServerStatszResp, error) + func (s *System) ServerStatszPing(ctx context.Context, opts StatszEventOptions) ([]ServerStatszResp, error) + func (s *System) ServerSubsz(ctx context.Context, id string, opts SubszOptions) (*SubszResp, error) + func (s *System) ServerSubszPing(ctx context.Context, opts SubszOptions) ([]SubszResp, error) + func (s *System) Varz(ctx context.Context, id string, opts VarzEventOptions) (*VarzResp, error) + func (s *System) VarzPing(ctx context.Context, opts VarzEventOptions) ([]VarzResp, error) + type TLSPeerCert struct + CertSha256 string + Subject string + SubjectPKISha256 string + type Varz struct + AuthRequired bool + AuthTimeout float64 + CPU float64 + ClientConnectURLs []string + Cluster ClusterOptsVarz + ConfigLoadTime time.Time + Connections int + Cores int + Gateway GatewayOptsVarz + GitCommit string + GoVersion string + HTTPBasePath string + HTTPHost string + HTTPPort int + HTTPReqStats map[string]uint64 + HTTPSPort int + Host string + ID string + IP string + InBytes int64 + InMsgs int64 + JetStream JetStreamVarz + LeafNode LeafNodeOptsVarz + Leafs int + MQTT MQTTOptsVarz + MaxConn int + MaxControlLine int32 + MaxPayload int + MaxPending int64 + MaxPingsOut int + MaxProcs int + MaxSubs int + Mem int64 + Name string + Now time.Time + OCSPResponseCache *OCSPResponseCacheVarz + OutBytes int64 + OutMsgs int64 + PingInterval time.Duration + PinnedAccountFail uint64 + Port int + Proto int + Remotes int + Routes int + SlowConsumers int64 + SlowConsumersStats *SlowConsumersStats + Start time.Time + Subscriptions uint32 + SystemAccount string + TLSOCSPPeerVerify bool + TLSRequired bool + TLSTimeout float64 + TLSVerify bool + Tags jwt.TagList + TotalConnections uint64 + TrustedOperatorsClaim []*jwt.OperatorClaims + TrustedOperatorsJwt []string + Uptime string + Version string + WSConnectURLs []string + Websocket WebsocketOptsVarz + WriteDeadline time.Duration + type VarzEventOptions struct + type VarzResp struct + Error APIError + Server ServerInfo + Varz Varz + type WebsocketOptsVarz struct + Advertise string + AllowedOrigins []string + AuthTimeout float64 + Compression bool + HandshakeTimeout time.Duration + Host string + JWTCookie string + NoAuthUser string + NoTLS bool + Port int + SameOrigin bool + TLSMap bool + TLSOCSPPeerVerify bool + TLSPinnedCerts []string