This repository has been archived by the owner on Oct 2, 2022. It is now read-only.
generated from ContainerSSH/library-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Janos Pasztor
committed
Mar 8, 2021
1 parent
7b2d246
commit a17f469
Showing
7 changed files
with
45 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# Message/error codes | ||
# Message / error codes | ||
|
||
| Code | Explanation | | ||
| `HTTP_CLIENT_CONNECTION_FAILED` | Sending a HTTP request failed for reasons outside of ContainerSSH | | ||
| `HTTP_CLIENT_DECODE_FAILED` | ContainerSSH failed to decode the JSON response after sending a request. Check if the HTTP server is misbehaving. | | ||
| `HTTP_CLIENT_ENCODE_FAILED` | ContainerSSH failed to encode the payload for sending a HTTP request. This is a bug, please file an issue. | | ||
| `HTTP_CLIENT_REDIRECTS_DISABLED` | ContainerSSH is refusing to follow a HTTP redirect received because the `allowRedirects` option is disabled. | | ||
| `HTTP_CLIENT_REDIRECT` | ContainerSSH has received a HTTP redirect from the server. | | ||
| `HTTP_CLIENT_RESPONSE` | ContainerSSH has received a response to a HTTP request sent to a server. | | ||
| `HTTP_CLIENT_REQUEST` | ContainerSSH is sending a HTTP request to a server. | | ||
|------|-------------| | ||
| `HTTP_CLIENT_CONNECTION_FAILED` | This message indicates a connection failure on the network level. | | ||
| `HTTP_CLIENT_DECODE_FAILED` | This message indicates that decoding the JSON response has failed. The status code is set for this code. | | ||
| `HTTP_CLIENT_ENCODE_FAILED` | This message indicates that JSON encoding the request failed. This is usually a bug. | | ||
| `HTTP_CLIENT_REDIRECT` | This message indicates that the server responded with a HTTP redirect. | | ||
| `HTTP_CLIENT_REDIRECTS_DISABLED` | This message indicates that ContainerSSH is not following a HTTP redirect sent by the server. Use the allowRedirects option to allow following HTTP redirects. | | ||
| `HTTP_CLIENT_REQUEST` | This message indicates that a HTTP request is being sent from ContainerSSH | | ||
| `HTTP_CLIENT_RESPONSE` | This message indicates that ContainerSSH received a HTTP response from a server. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package http | ||
|
||
const ( | ||
// EFailureEncodeFailed indicates that JSON encoding the request failed. This is usually a bug. | ||
EFailureEncodeFailed = "HTTP_CLIENT_ENCODE_FAILED" | ||
// EFailureConnectionFailed indicates a connection failure on the network level. | ||
EFailureConnectionFailed = "HTTP_CLIENT_CONNECTION_FAILED" | ||
// EFailureDecodeFailed indicates that decoding the JSON response has failed. The status code is set for this | ||
// code. | ||
EFailureDecodeFailed = "HTTP_CLIENT_DECODE_FAILED" | ||
// EClientRedirectsDisabled indicates that ContainerSSH is not following a HTTP redirect sent by the server. | ||
EClientRedirectsDisabled = "HTTP_CLIENT_REDIRECTS_DISABLED" | ||
// This message indicates that JSON encoding the request failed. This is usually a bug. | ||
const EFailureEncodeFailed = "HTTP_CLIENT_ENCODE_FAILED" | ||
|
||
// MClientRequest is a message indicating a HTTP request sent from ContainerSSH | ||
MClientRequest = "HTTP_CLIENT_REQUEST" | ||
// This message indicates a connection failure on the network level. | ||
const EFailureConnectionFailed = "HTTP_CLIENT_CONNECTION_FAILED" | ||
|
||
// MClientRedirect indicates that the server has sent a HTTP redirect. | ||
MClientRedirect = "HTTP_CLIENT_REDIRECT" | ||
// This message indicates that decoding the JSON response has failed. The status code is set for this | ||
// code. | ||
const EFailureDecodeFailed = "HTTP_CLIENT_DECODE_FAILED" | ||
|
||
// MClientResponse is a message indicating receiving a HTTP response to a client request | ||
MClientResponse = "HTTP_CLIENT_RESPONSE" | ||
) | ||
// This message indicates that ContainerSSH is not following a HTTP redirect sent by the server. Use the allowRedirects | ||
// option to allow following HTTP redirects. | ||
const EClientRedirectsDisabled = "HTTP_CLIENT_REDIRECTS_DISABLED" | ||
|
||
// This message indicates that a HTTP request is being sent from ContainerSSH | ||
const MClientRequest = "HTTP_CLIENT_REQUEST" | ||
|
||
// This message indicates that the server responded with a HTTP redirect. | ||
const MClientRedirect = "HTTP_CLIENT_REDIRECT" | ||
|
||
// This message indicates that ContainerSSH received a HTTP response from a server. | ||
const MClientResponse = "HTTP_CLIENT_RESPONSE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package http | ||
|
||
//go:generate containerssh-generate-codes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters