-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from junkurihara/feat/cache-hyper-1.0
feat: cache hyper 1.0 with stream body directly attached to response stream
- Loading branch information
Showing
20 changed files
with
894 additions
and
121 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use thiserror::Error; | ||
|
||
pub type CacheResult<T> = std::result::Result<T, CacheError>; | ||
|
||
/// Describes things that can go wrong in the Rpxy | ||
#[derive(Debug, Error)] | ||
pub enum CacheError { | ||
// Cache errors, | ||
#[error("Invalid null request and/or response")] | ||
NullRequestOrResponse, | ||
|
||
#[error("Failed to write byte buffer")] | ||
FailedToWriteByteBufferForCache, | ||
|
||
#[error("Failed to acquire mutex lock for cache")] | ||
FailedToAcquiredMutexLockForCache, | ||
|
||
#[error("Failed to acquire mutex lock for check")] | ||
FailedToAcquiredMutexLockForCheck, | ||
|
||
#[error("Failed to create file cache")] | ||
FailedToCreateFileCache, | ||
|
||
#[error("Failed to write file cache")] | ||
FailedToWriteFileCache, | ||
|
||
#[error("Failed to open cache file")] | ||
FailedToOpenCacheFile, | ||
|
||
#[error("Too large to cache")] | ||
TooLargeToCache, | ||
|
||
#[error("Failed to cache bytes: {0}")] | ||
FailedToCacheBytes(String), | ||
|
||
#[error("Failed to send frame to cache {0}")] | ||
FailedToSendFrameToCache(String), | ||
|
||
#[error("Failed to send frame from file cache {0}")] | ||
FailedToSendFrameFromCache(String), | ||
|
||
#[error("Failed to remove cache file: {0}")] | ||
FailedToRemoveCacheFile(String), | ||
|
||
#[error("Invalid cache target")] | ||
InvalidCacheTarget, | ||
|
||
#[error("Hash mismatched in cache file")] | ||
HashMismatchedInCacheFile, | ||
} |
Oops, something went wrong.