github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/session/string.go (about)

     1  package session
     2  
     3  import (
     4  	session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc"
     5  )
     6  
     7  // String returns string representation of ObjectSessionVerb.
     8  func (x ObjectSessionVerb) String() string {
     9  	return ObjectSessionVerbToGRPCField(x).String()
    10  }
    11  
    12  // FromString parses ObjectSessionVerb from a string representation.
    13  // It is a reverse action to String().
    14  //
    15  // Returns true if s was parsed successfully.
    16  func (x *ObjectSessionVerb) FromString(s string) bool {
    17  	var g session.ObjectSessionContext_Verb
    18  
    19  	ok := g.FromString(s)
    20  
    21  	if ok {
    22  		*x = ObjectSessionVerbFromGRPCField(g)
    23  	}
    24  
    25  	return ok
    26  }
    27  
    28  // String returns string representation of ContainerSessionVerb.
    29  func (x ContainerSessionVerb) String() string {
    30  	return ContainerSessionVerbToGRPCField(x).String()
    31  }
    32  
    33  // FromString parses ContainerSessionVerb from a string representation.
    34  // It is a reverse action to String().
    35  //
    36  // Returns true if s was parsed successfully.
    37  func (x *ContainerSessionVerb) FromString(s string) bool {
    38  	var g session.ContainerSessionContext_Verb
    39  
    40  	ok := g.FromString(s)
    41  
    42  	if ok {
    43  		*x = ContainerSessionVerbFromGRPCField(g)
    44  	}
    45  
    46  	return ok
    47  }