[#302] pkg/session: Document default values set in NewToken

Document field values of instance constructed via `NewToken`.
Assert the values in corresponding unit test.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-06-08 20:35:03 +03:00 committed by Alex Vanin
parent 707776976a
commit fb77bd3511
2 changed files with 30 additions and 0 deletions

View file

@ -24,6 +24,15 @@ func NewTokenFromV2(tV2 *session.SessionToken) *Token {
}
// NewToken creates and returns blank Token.
//
// Defaults:
// - body: nil;
// - id: nil;
// - ownerId: nil;
// - sessionKey: nil;
// - exp: 0;
// - iat: 0;
// - nbf: 0;
func NewToken() *Token {
return NewTokenFromV2(new(session.SessionToken))
}