forked from TrueCloudLab/frostfs-sdk-go
[#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
This commit is contained in:
parent
5361f0eceb
commit
6ce73790ea
337 changed files with 66666 additions and 283 deletions
32
api/session/status.go
Normal file
32
api/session/status.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status"
|
||||
statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/grpc"
|
||||
)
|
||||
|
||||
// LocalizeFailStatus checks if passed global status.Code is related to session failure and:
|
||||
//
|
||||
// then localizes the code and returns true,
|
||||
// else leaves the code unchanged and returns false.
|
||||
//
|
||||
// Arg must not be nil.
|
||||
func LocalizeFailStatus(c *status.Code) bool {
|
||||
return status.LocalizeIfInSection(c, uint32(statusgrpc.Section_SECTION_SESSION))
|
||||
}
|
||||
|
||||
// GlobalizeFail globalizes local code of session failure.
|
||||
//
|
||||
// Arg must not be nil.
|
||||
func GlobalizeFail(c *status.Code) {
|
||||
c.GlobalizeSection(uint32(statusgrpc.Section_SECTION_SESSION))
|
||||
}
|
||||
|
||||
const (
|
||||
// StatusTokenNotFound is a local status.Code value for
|
||||
// TOKEN_NOT_FOUND session failure.
|
||||
StatusTokenNotFound status.Code = iota
|
||||
// StatusTokenExpired is a local status.Code value for
|
||||
// TOKEN_EXPIRED session failure.
|
||||
StatusTokenExpired
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue