From 2f6bef59299f700ea7e69f2fa2d8792c02903933 Mon Sep 17 00:00:00 2001 From: Piotr Piotrowski Date: Wed, 10 Aug 2022 10:49:46 +0200 Subject: [PATCH] Update StreamSourceInfo struct --- jsm.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/jsm.go b/jsm.go index 8d8545012..1e6baf1d0 100644 --- a/jsm.go +++ b/jsm.go @@ -154,8 +154,8 @@ type ExternalStream struct { DeliverPrefix string `json:"deliver"` } -// apiError is included in all API responses if there was an error. -type apiError struct { +// APIError is included in all API responses if there was an error. +type APIError struct { Code int `json:"code"` ErrorCode int `json:"err_code"` Description string `json:"description,omitempty"` @@ -164,7 +164,7 @@ type apiError struct { // apiResponse is a standard response from the JetStream JSON API type apiResponse struct { Type string `json:"type"` - Error *apiError `json:"error,omitempty"` + Error *APIError `json:"error,omitempty"` } // apiPaged includes variables used to create paged responses from the JSON API @@ -724,9 +724,11 @@ type StreamInfo struct { // StreamSourceInfo shows information about an upstream stream source. type StreamSourceInfo struct { - Name string `json:"name"` - Lag uint64 `json:"lag"` - Active time.Duration `json:"active"` + Name string `json:"name"` + Lag uint64 `json:"lag"` + Active time.Duration `json:"active"` + External *ExternalStream `json:"external"` + Error *APIError `json:"error"` } // StreamState is information about the given stream.