forked from TrueCloudLab/frostfs-http-gw
[#70] Support bucket/container caching
Mainly it was added because we need to know if TZ hashing is disabled or not for container Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
8bc246f8f9
commit
9a5a2239bd
17 changed files with 283 additions and 48 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-http-gw/response"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-http-gw/tokens"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
||||
"github.com/valyala/fasthttp"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -58,3 +59,13 @@ func isValidValue(s string) bool {
|
|||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func logAndSendBucketError(c *fasthttp.RequestCtx, log *zap.Logger, err error) {
|
||||
log.Error(logs.CouldntGetBucket, zap.Error(err))
|
||||
|
||||
if client.IsErrContainerNotFound(err) {
|
||||
response.Error(c, "Not Found", fasthttp.StatusNotFound)
|
||||
return
|
||||
}
|
||||
response.Error(c, "could not get bucket: "+err.Error(), fasthttp.StatusBadRequest)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue