forked from TrueCloudLab/frostfs-sdk-go
[#158] client: Support object context in session token setter
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
d109594d75
commit
bf23b548ab
1 changed files with 4 additions and 1 deletions
|
@ -200,7 +200,8 @@ func (t *Token) Signature() *signature.Signature {
|
|||
// SetContext sets context of the Token.
|
||||
//
|
||||
// Supported contexts:
|
||||
// - *ContainerContext.
|
||||
// - *ContainerContext,
|
||||
// - *ObjectContext.
|
||||
//
|
||||
// Resets context if it is not supported.
|
||||
func (t *Token) SetContext(v interface{}) {
|
||||
|
@ -209,6 +210,8 @@ func (t *Token) SetContext(v interface{}) {
|
|||
switch c := v.(type) {
|
||||
case *ContainerContext:
|
||||
cV2 = c.ToV2()
|
||||
case *ObjectContext:
|
||||
cV2 = c.ToV2()
|
||||
}
|
||||
|
||||
t.setBodyField(func(body *session.TokenBody) {
|
||||
|
|
Loading…
Reference in a new issue