[#128] session: Sync comments and constructors

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-02-01 13:21:25 +03:00 committed by Alex Vanin
parent 6d3d91f889
commit 2fff3fd9ec
3 changed files with 9 additions and 9 deletions

View file

@ -22,12 +22,12 @@ func NewContainerContext() *ContainerContext {
v2 := new(session.ContainerSessionContext)
v2.SetWildcard(true)
return ContainerContextFromV2(v2)
return NewContainerContextFromV2(v2)
}
// ContainerContextFromV2 wraps session.ContainerSessionContext
// NewContainerContextFromV2 wraps session.ContainerSessionContext
// into ContainerContext.
func ContainerContextFromV2(v *session.ContainerSessionContext) *ContainerContext {
func NewContainerContextFromV2(v *session.ContainerSessionContext) *ContainerContext {
return (*ContainerContext)(v)
}
@ -47,7 +47,7 @@ func (x *ContainerContext) ApplyTo(id *cid.ID) {
v2.SetContainerID(id.ToV2())
}
// ActOnAllContainers is a helper function that conveniently
// ApplyToAllContainers is a helper function that conveniently
// applies ContainerContext to all containers.
func ApplyToAllContainers(c *ContainerContext) {
c.ApplyTo(nil)

View file

@ -21,12 +21,12 @@ type ObjectContext session.ObjectSessionContext
func NewObjectContext() *ObjectContext {
v2 := new(session.ObjectSessionContext)
return ObjectContextFromV2(v2)
return NewObjectContextFromV2(v2)
}
// ObjectContextFromV2 wraps session.ObjectSessionContext
// NewObjectContextFromV2 wraps session.ObjectSessionContext
// into ObjectContext.
func ObjectContextFromV2(v *session.ObjectSessionContext) *ObjectContext {
func NewObjectContextFromV2(v *session.ObjectSessionContext) *ObjectContext {
return (*ObjectContext)(v)
}

View file

@ -236,9 +236,9 @@ func (t *Token) Context() interface{} {
default:
return nil
case *session.ContainerSessionContext:
return ContainerContextFromV2(c)
return NewContainerContextFromV2(c)
case *session.ObjectSessionContext:
return ObjectContextFromV2(c)
return NewObjectContextFromV2(c)
}
}