forked from TrueCloudLab/frostfs-api-go
[#194] pkg/container: Implement container constructor with format check
Implement NewVerifiedFromV2 function that verifies format of NeoFS API V2 Container message. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
70c29ca3e5
commit
7988405753
3 changed files with 80 additions and 0 deletions
|
@ -42,6 +42,10 @@ func (c *Container) ToV2() *container.Container {
|
|||
return &c.v2
|
||||
}
|
||||
|
||||
// NewVerifiedFromV2 constructs Container from NeoFS API V2 Container message.
|
||||
//
|
||||
// Does not perform if message meets NeoFS API V2 specification. To do this
|
||||
// use NewVerifiedFromV2 constructor.
|
||||
func NewContainerFromV2(c *container.Container) *Container {
|
||||
cnr := new(Container)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue