Documentation
¶
Index ¶
- Constants
- Variables
- type FetchOpt
- type FetchOpts
- type HealthStatus
- type Healthz
- type HealthzResp
- type JSZResp
- type SysClient
- func (s *SysClient) CollectClusterAccounts(timeout time.Duration, active int) ([]*server.AccountDetail, error)
- func (s *SysClient) Fetch(subject string, data []byte, opts ...FetchOpt) ([]*nats.Msg, error)
- func (s *SysClient) FetchJszPaged(baseOpts server.JszEventOptions, limit int, timeout time.Duration, active int, ...) error
- func (s *SysClient) FindServers(stdin bool, expected int, timeout time.Duration, readTimeout time.Duration, ...) ([]JSZResp, error)
- func (s *SysClient) Healthz(id string, opts server.HealthzOptions) (*HealthzResp, error)
- func (s *SysClient) JszPing(opts server.JszEventOptions, fopts ...FetchOpt) ([]JSZResp, error)
Constants ¶
const (
DefaultRequestTimeout = 60 * time.Second
)
Variables ¶
var ( ErrValidation = errors.New("validation error") ErrInvalidServerID = errors.New("server with given ID does not exist") )
Functions ¶
This section is empty.
Types ¶
type HealthStatus ¶
type HealthStatus int
const ( StatusOK HealthStatus = iota StatusError )
func (HealthStatus) MarshalJSON ¶
func (hs HealthStatus) MarshalJSON() ([]byte, error)
func (HealthStatus) String ¶
func (hs HealthStatus) String() string
func (*HealthStatus) UnmarshalJSON ¶
func (hs *HealthStatus) UnmarshalJSON(data []byte) error
type Healthz ¶
type Healthz struct {
Status HealthStatus `json:"status"`
Error string `json:"error,omitempty"`
}
type HealthzResp ¶
type HealthzResp struct {
Server server.ServerInfo `json:"server"`
Healthz Healthz `json:"data"`
}
type JSZResp ¶
type JSZResp struct {
Server server.ServerInfo `json:"server"`
JSInfo server.JSInfo `json:"data"`
}
type SysClient ¶
type SysClient struct {
// contains filtered or unexported fields
}
SysClient can be used to request monitoring data from the server. This is used by the stream-check and consumer-check commands
func (*SysClient) CollectClusterAccounts ¶ added in v0.3.0
func (s *SysClient) CollectClusterAccounts(timeout time.Duration, active int) ([]*server.AccountDetail, error)
CollectClusterAccounts gathers account-level JetStream metadata from the cluster. It fetches paged JSZ responses and merges streams across pages for each account.
func (*SysClient) Fetch ¶
Fetch publishes a request to the given subject and collects replies. If FetchOpts.Expected > 0, it blocks until that number of replies is received or the timeout elapses. If FetchOpts.Expected == 0, it collects as many replies as possible until the discovery interval elapses with no new data.
func (*SysClient) FetchJszPaged ¶ added in v0.3.0
func (s *SysClient) FetchJszPaged(baseOpts server.JszEventOptions, limit int, timeout time.Duration, active int, fn func([]*server.AccountDetail)) error
FetchJszPaged pages through JSZ account data from all servers. It calls the provided function for each page of AccountDetail results.
func (*SysClient) FindServers ¶
func (*SysClient) Healthz ¶
func (s *SysClient) Healthz(id string, opts server.HealthzOptions) (*HealthzResp, error)