[#302] pkg/container: Document default values set in New

Make `nil` as a default value for attributes.
Document field values of instance constructed
via `New`. 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 16:32:29 +03:00 committed by Alex Vanin
parent c08b90dbbc
commit f92f9cd424
3 changed files with 46 additions and 2 deletions

View file

@ -20,6 +20,17 @@ type Container struct {
sig *pkg.Signature
}
// New creates, initializes and returns blank Container instance.
//
// Defaults:
// - token: nil;
// - sig: nil;
// - basicACL: acl.PrivateBasicRule;
// - version: nil;
// - nonce: random UUID;
// - attr: nil;
// - policy: nil;
// - ownerID: nil.
func New(opts ...NewOption) *Container {
cnrOptions := defaultContainerOptions()