container

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 22

Documentation

Index

Constants

View Source
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 Attribute

type Attribute container.Attribute

func NewAttribute

func NewAttribute() *Attribute

func NewAttributeFromV2

func NewAttributeFromV2(v *container.Attribute) *Attribute

func (*Attribute) Key

func (a *Attribute) Key() string

func (*Attribute) SetKey

func (a *Attribute) SetKey(v string)

func (*Attribute) SetValue

func (a *Attribute) SetValue(v string)

func (*Attribute) ToV2

func (a *Attribute) ToV2() *container.Attribute

func (*Attribute) Value

func (a *Attribute) Value() string

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 New

func New(opts ...NewOption) *Container

func NewContainerFromV2

func NewContainerFromV2(c *container.Container) *Container

func (*Container) Attributes

func (c *Container) Attributes() Attributes

func (*Container) BasicACL

func (c *Container) BasicACL() uint32

func (*Container) Marshal

func (c *Container) Marshal(b ...[]byte) ([]byte, error)

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

func (c *Container) MarshalJSON() ([]byte, error)

MarshalJSON encodes Container to protobuf JSON format.

func (*Container) Nonce

func (c *Container) Nonce() []byte

func (*Container) OwnerID

func (c *Container) OwnerID() *owner.ID

func (*Container) PlacementPolicy

func (c *Container) PlacementPolicy() *netmap.PlacementPolicy

func (*Container) SetAttributes

func (c *Container) SetAttributes(v Attributes)

func (*Container) SetBasicACL

func (c *Container) SetBasicACL(v uint32)

func (*Container) SetNonce

func (c *Container) SetNonce(v []byte)

func (*Container) SetOwnerID

func (c *Container) SetOwnerID(v *owner.ID)

func (*Container) SetPlacementPolicy

func (c *Container) SetPlacementPolicy(v *netmap.PlacementPolicy)

func (*Container) SetVersion

func (c *Container) SetVersion(v *pkg.Version)

func (*Container) ToV2

func (c *Container) ToV2() *container.Container

func (*Container) Unmarshal

func (c *Container) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Container.

func (*Container) UnmarshalJSON

func (c *Container) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Container from protobuf JSON format.

func (*Container) Version

func (c *Container) Version() *pkg.Version

type ID

type ID refs.ContainerID

ID represents v2-compatible container identifier.

func CalculateID

func CalculateID(c *Container) *ID

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) Equal

func (id *ID) Equal(id2 *ID) bool

Equal returns true if identifiers are identical.

func (*ID) Marshal

func (id *ID) Marshal(b ...[]byte) ([]byte, error)

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

func (id *ID) MarshalJSON() ([]byte, error)

MarshalJSON encodes ID to protobuf JSON format.

func (*ID) Parse

func (id *ID) Parse(s string) error

Parse converts base58 string representation into ID.

func (*ID) SetSHA256

func (id *ID) SetSHA256(v [sha256.Size]byte)

SetSHA256 sets container identifier value to SHA256 checksum.

func (*ID) String

func (id *ID) String() string

String returns base58 string representation of ID.

func (*ID) ToV2

func (id *ID) ToV2() *refs.ContainerID

ToV2 returns the v2 container ID message.

func (*ID) Unmarshal

func (id *ID) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of ID.

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ID from protobuf JSON format.

type NewOption

type NewOption interface {
	// contains filtered or unexported methods
}

func WithAttribute

func WithAttribute(key, value string) NewOption

func WithCustomBasicACL

func WithCustomBasicACL(acl uint32) NewOption

func WithNEO3Wallet

func WithNEO3Wallet(w *owner.NEO3Wallet) NewOption

func WithNonce

func WithNonce(nonce uuid.UUID) NewOption

func WithOwnerID

func WithOwnerID(id *owner.ID) NewOption

func WithPolicy

func WithPolicy(policy *netmap.PlacementPolicy) NewOption

func WithPublicBasicACL

func WithPublicBasicACL() NewOption

func WithReadOnlyBasicACL

func WithReadOnlyBasicACL() NewOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL