frostfs-sdk-go/api/session/string.go
Evgenii Stratonikov 328d214d2d
All checks were successful
DCO / DCO (pull_request) Successful in 26s
Tests and linters / Tests (pull_request) Successful in 46s
Tests and linters / Lint (pull_request) Successful in 1m52s
[#317] api: Revert easyproto marshaler usage
It has caused a noticeable degradation in node.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-01-09 11:46:09 +03:00

43 lines
1.2 KiB
Go

package session
import (
session "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc"
)
// String returns string representation of ObjectSessionVerb.
func (x ObjectSessionVerb) String() string {
return ObjectSessionVerbToGRPCField(x).String()
}
// FromString parses ObjectSessionVerb from a string representation.
// It is a reverse action to String().
//
// Returns true if s was parsed successfully.
func (x *ObjectSessionVerb) FromString(s string) bool {
g, ok := session.ObjectSessionContext_Verb_value[s]
if ok {
*x = ObjectSessionVerbFromGRPCField(session.ObjectSessionContext_Verb(g))
}
return ok
}
// String returns string representation of ContainerSessionVerb.
func (x ContainerSessionVerb) String() string {
return ContainerSessionVerbToGRPCField(x).String()
}
// FromString parses ContainerSessionVerb from a string representation.
// It is a reverse action to String().
//
// Returns true if s was parsed successfully.
func (x *ContainerSessionVerb) FromString(s string) bool {
g, ok := session.ContainerSessionContext_Verb_value[s]
if ok {
*x = ContainerSessionVerbFromGRPCField(session.ContainerSessionContext_Verb(g))
}
return ok
}