Documentation ¶
Index ¶
- Constants
- type Attribute
- type Attributes
- type Container
- func (c *Container) Attributes() Attributes
- func (c *Container) BasicACL() uint32
- func (c *Container) Marshal(b ...[]byte) ([]byte, error)
- func (c *Container) MarshalJSON() ([]byte, error)
- func (c *Container) Nonce() []byte
- func (c *Container) OwnerID() *owner.ID
- func (c *Container) PlacementPolicy() *netmap.PlacementPolicy
- func (c *Container) SetAttributes(v Attributes)
- func (c *Container) SetBasicACL(v uint32)
- func (c *Container) SetNonce(v []byte)
- func (c *Container) SetOwnerID(v *owner.ID)
- func (c *Container) SetPlacementPolicy(v *netmap.PlacementPolicy)
- func (c *Container) SetVersion(v *pkg.Version)
- func (c *Container) ToV2() *container.Container
- func (c *Container) Unmarshal(data []byte) error
- func (c *Container) UnmarshalJSON(data []byte) error
- func (c *Container) Version() *pkg.Version
- type ID
- func (id *ID) Equal(id2 *ID) bool
- func (id *ID) Marshal(b ...[]byte) ([]byte, error)
- func (id *ID) MarshalJSON() ([]byte, error)
- func (id *ID) Parse(s string) error
- func (id *ID) SetSHA256(v [sha256.Size]byte)
- func (id *ID) String() string
- func (id *ID) ToV2() *refs.ContainerID
- func (id *ID) Unmarshal(data []byte) error
- func (id *ID) UnmarshalJSON(data []byte) error
- type NewOption
- func WithAttribute(key, value string) NewOption
- func WithCustomBasicACL(acl uint32) NewOption
- func WithNEO3Wallet(w *owner.NEO3Wallet) NewOption
- func WithNonce(nonce uuid.UUID) NewOption
- func WithOwnerID(id *owner.ID) NewOption
- func WithPolicy(policy *netmap.PlacementPolicy) NewOption
- func WithPublicBasicACL() NewOption
- func WithReadOnlyBasicACL() NewOption
Constants ¶
const ( // AttributeName is an attribute key that is commonly used to denote // human-friendly name. AttributeName = "Name" // AttributeTimestamp is an attribute key that is commonly used to denote // user-defined local time of container creation in Unix Timestamp format. AttributeTimestamp = "Timestamp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes []*Attribute
func NewAttributesFromV2 ¶
func NewAttributesFromV2(v []*container.Attribute) Attributes
func (Attributes) ToV2 ¶
func (a Attributes) ToV2() []*container.Attribute
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainerFromV2 ¶
func (*Container) Attributes ¶
func (c *Container) Attributes() Attributes
func (*Container) Marshal ¶
Marshal marshals Container into a protobuf binary form.
Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.
func (*Container) MarshalJSON ¶
MarshalJSON encodes Container to protobuf JSON format.
func (*Container) PlacementPolicy ¶
func (c *Container) PlacementPolicy() *netmap.PlacementPolicy
func (*Container) SetAttributes ¶
func (c *Container) SetAttributes(v Attributes)
func (*Container) SetBasicACL ¶
func (*Container) SetOwnerID ¶
func (*Container) SetPlacementPolicy ¶
func (c *Container) SetPlacementPolicy(v *netmap.PlacementPolicy)
func (*Container) SetVersion ¶
func (*Container) UnmarshalJSON ¶
UnmarshalJSON decodes Container from protobuf JSON format.
type ID ¶
type ID refs.ContainerID
ID represents v2-compatible container identifier.
func CalculateID ¶
CalculateID calculates container identifier based on its structure.
func NewID ¶
func NewID() *ID
NewID creates and initializes blank ID.
Works similar to NewIDFromV2(new(ContainerID)).
func NewIDFromV2 ¶
func NewIDFromV2(idV2 *refs.ContainerID) *ID
NewIDFromV2 wraps v2 ContainerID message to ID.
func (*ID) Marshal ¶
Marshal marshals ID into a protobuf binary form.
Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.
func (*ID) MarshalJSON ¶
MarshalJSON encodes ID to protobuf JSON format.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON decodes ID from protobuf JSON format.
type NewOption ¶
type NewOption interface {
// contains filtered or unexported methods
}
func WithAttribute ¶
func WithCustomBasicACL ¶
func WithNEO3Wallet ¶
func WithNEO3Wallet(w *owner.NEO3Wallet) NewOption
func WithOwnerID ¶
func WithPolicy ¶
func WithPolicy(policy *netmap.PlacementPolicy) NewOption
func WithPublicBasicACL ¶
func WithPublicBasicACL() NewOption
func WithReadOnlyBasicACL ¶
func WithReadOnlyBasicACL() NewOption