Skip to content

Commit

Permalink
Merge pull request #1039 from nats-io/stream--source-update
Browse files Browse the repository at this point in the history
[UPDATED] Align StreamSourceInfo schema with server
  • Loading branch information
kozlovic committed Aug 10, 2022
2 parents c157d64 + 2f6bef5 commit eaaf39d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions jsm.go
Expand Up @@ -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"`
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit eaaf39d

Please sign in to comment.