github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/acl/grpc/types.go (about) 1 package acl 2 3 import ( 4 refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" 5 ) 6 7 // SetVersion sets version of EACL rules in table. 8 func (m *EACLTable) SetVersion(v *refs.Version) { 9 m.Version = v 10 } 11 12 // SetContainerId sets container identifier of the eACL table. 13 func (m *EACLTable) SetContainerId(v *refs.ContainerID) { 14 m.ContainerId = v 15 } 16 17 // SetRecords sets record list of the eACL table. 18 func (m *EACLTable) SetRecords(v []*EACLRecord) { 19 m.Records = v 20 } 21 22 // SetOperation sets operation of the eACL record. 23 func (m *EACLRecord) SetOperation(v Operation) { 24 m.Operation = v 25 } 26 27 // SetAction sets action of the eACL record. 28 func (m *EACLRecord) SetAction(v Action) { 29 m.Action = v 30 } 31 32 // SetFilters sets filter list of the eACL record. 33 func (m *EACLRecord) SetFilters(v []*EACLRecord_Filter) { 34 m.Filters = v 35 } 36 37 // SetTargets sets target list of the eACL record. 38 func (m *EACLRecord) SetTargets(v []*EACLRecord_Target) { 39 m.Targets = v 40 } 41 42 // SetHeader sets header type of the eACL filter. 43 func (m *EACLRecord_Filter) SetHeader(v HeaderType) { 44 m.HeaderType = v 45 } 46 47 // SetMatchType sets match type of the eACL filter. 48 func (m *EACLRecord_Filter) SetMatchType(v MatchType) { 49 m.MatchType = v 50 } 51 52 // SetKey sets key of the eACL filter. 53 func (m *EACLRecord_Filter) SetKey(v string) { 54 m.Key = v 55 } 56 57 // SetValue sets value of the eACL filter. 58 func (m *EACLRecord_Filter) SetValue(v string) { 59 m.Value = v 60 } 61 62 // SetRole sets target group of the eACL target. 63 func (m *EACLRecord_Target) SetRole(v Role) { 64 m.Role = v 65 } 66 67 // SetKeys of the eACL target. 68 func (m *EACLRecord_Target) SetKeys(v [][]byte) { 69 m.Keys = v 70 } 71 72 // SetEaclTable sets eACL table of the bearer token. 73 func (m *BearerToken_Body) SetEaclTable(v *EACLTable) { 74 m.EaclTable = v 75 } 76 77 // SetOwnerId sets identifier of the bearer token owner. 78 func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) { 79 m.OwnerId = v 80 } 81 82 // SetLifetime sets lifetime of the bearer token. 83 func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { 84 m.Lifetime = v 85 } 86 87 // SetBody sets bearer token body. 88 func (m *BearerToken) SetBody(v *BearerToken_Body) { 89 m.Body = v 90 } 91 92 // SetSignature sets bearer token signature. 93 func (m *BearerToken) SetSignature(v *refs.Signature) { 94 m.Signature = v 95 } 96 97 // SetExp sets epoch number of the token expiration. 98 func (m *BearerToken_Body_TokenLifetime) SetExp(v uint64) { 99 m.Exp = v 100 } 101 102 // SetNbf sets starting epoch number of the token. 103 func (m *BearerToken_Body_TokenLifetime) SetNbf(v uint64) { 104 m.Nbf = v 105 } 106 107 // SetIat sets the number of the epoch in which the token was issued. 108 func (m *BearerToken_Body_TokenLifetime) SetIat(v uint64) { 109 m.Iat = v 110 } 111 112 // FromString parses Action from a string representation, 113 // It is a reverse action to String(). 114 // 115 // Returns true if s was parsed successfully. 116 func (x *Action) FromString(s string) bool { 117 i, ok := Action_value[s] 118 if ok { 119 *x = Action(i) 120 } 121 122 return ok 123 } 124 125 // FromString parses Role from a string representation, 126 // It is a reverse action to String(). 127 // 128 // Returns true if s was parsed successfully. 129 func (x *Role) FromString(s string) bool { 130 i, ok := Role_value[s] 131 if ok { 132 *x = Role(i) 133 } 134 135 return ok 136 } 137 138 // FromString parses Operation from a string representation, 139 // It is a reverse action to String(). 140 // 141 // Returns true if s was parsed successfully. 142 func (x *Operation) FromString(s string) bool { 143 i, ok := Operation_value[s] 144 if ok { 145 *x = Operation(i) 146 } 147 148 return ok 149 } 150 151 // FromString parses MatchType from a string representation, 152 // It is a reverse action to String(). 153 // 154 // Returns true if s was parsed successfully. 155 func (x *MatchType) FromString(s string) bool { 156 i, ok := MatchType_value[s] 157 if ok { 158 *x = MatchType(i) 159 } 160 161 return ok 162 } 163 164 // FromString parses HeaderType from a string representation, 165 // It is a reverse action to String(). 166 // 167 // Returns true if s was parsed successfully. 168 func (x *HeaderType) FromString(s string) bool { 169 i, ok := HeaderType_value[s] 170 if ok { 171 *x = HeaderType(i) 172 } 173 174 return ok 175 }