Documentation ¶
Index ¶
- type AccessIdentifiers
- func (a *AccessIdentifiers) Parent() *object.Object
- func (a *AccessIdentifiers) ParentID() *oid.ID
- func (a AccessIdentifiers) SelfID() oid.ID
- func (a *AccessIdentifiers) WithParent(v *object.Object) *AccessIdentifiers
- func (a *AccessIdentifiers) WithParentID(v *oid.ID) *AccessIdentifiers
- func (a *AccessIdentifiers) WithSelfID(v oid.ID) *AccessIdentifiers
- type FormatterParams
- type ObjectTarget
- type TargetInitializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessIdentifiers ¶ added in v0.12.0
type AccessIdentifiers struct {
// contains filtered or unexported fields
}
AccessIdentifiers represents group of the object identifiers that are returned after writing the object. Consists of the ID of the stored object and the ID of the parent object.
func (*AccessIdentifiers) Parent ¶ added in v0.13.1
func (a *AccessIdentifiers) Parent() *object.Object
Parent return identifier of the parent of the written object.
func (*AccessIdentifiers) ParentID ¶ added in v0.12.0
func (a *AccessIdentifiers) ParentID() *oid.ID
ParentID return identifier of the parent of the written object.
func (AccessIdentifiers) SelfID ¶ added in v0.12.0
func (a AccessIdentifiers) SelfID() oid.ID
SelfID returns identifier of the written object.
func (*AccessIdentifiers) WithParent ¶ added in v0.13.1
func (a *AccessIdentifiers) WithParent(v *object.Object) *AccessIdentifiers
WithParent returns AccessIdentifiers with passed parent identifier.
func (*AccessIdentifiers) WithParentID ¶ added in v0.12.0
func (a *AccessIdentifiers) WithParentID(v *oid.ID) *AccessIdentifiers
WithParentID returns AccessIdentifiers with passed parent identifier.
func (*AccessIdentifiers) WithSelfID ¶ added in v0.12.0
func (a *AccessIdentifiers) WithSelfID(v oid.ID) *AccessIdentifiers
WithSelfID returns AccessIdentifiers with passed self identifier.
type FormatterParams ¶ added in v0.12.0
type FormatterParams struct { Key *ecdsa.PrivateKey NextTarget ObjectTarget SessionToken *session.Object NetworkState netmap.State }
FormatterParams groups NewFormatTarget parameters.
type ObjectTarget ¶ added in v0.12.0
type ObjectTarget interface { // WriteHeader writes object header w/ payload part. // The payload of the object may be incomplete. // // Must be called exactly once. Control remains with the caller. // Missing a call or re-calling can lead to undefined behavior // that depends on the implementation. // // Must not be called after Close call. WriteHeader(*object.Object) error // Write writes object payload chunk. // // Can be called multiple times. // // Must not be called after Close call. io.Writer // Close is used to finish object writing. // // Close must return access identifiers of the object // that has been written. // // Must be called no more than once. Control remains with the caller. // Re-calling can lead to undefined behavior // that depends on the implementation. Close() (*AccessIdentifiers, error) }
ObjectTarget is an interface of the object writer.
func NewFormatTarget ¶ added in v0.12.0
func NewFormatTarget(p *FormatterParams) ObjectTarget
NewFormatTarget returns ObjectTarget instance that finalizes object structure and writes it to the next target.
Chunks must be written before the WriteHeader call.
Object changes: - sets version to current SDK version; - sets payload size to the total length of all written chunks; - sets session token; - sets number of creation epoch; - calculates and sets verification fields (ID, Signature).
func NewPayloadSizeLimiter ¶ added in v0.12.0
func NewPayloadSizeLimiter(maxSize uint64, targetInit TargetInitializer) ObjectTarget
NewPayloadSizeLimiter returns ObjectTarget instance that restricts payload length of the writing object and writes generated objects to targets from initializer.
Objects w/ payload size less or equal than max size remain untouched.
type TargetInitializer ¶ added in v0.12.0
type TargetInitializer func() ObjectTarget
TargetInitializer represents ObjectTarget constructor.