Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- func (*Address) Descriptor() ([]byte, []int)
- func (m Address) Equal(a2 *Address) bool
- func (m Address) Hash() ([]byte, error)
- func (m Address) IsFull() bool
- func (m *Address) Marshal() (dAtA []byte, err error)
- func (m *Address) MarshalTo(dAtA []byte) (int, error)
- func (m *Address) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *Address) Parse(addr string) error
- func (*Address) ProtoMessage()
- func (m *Address) Reset()
- func (m *Address) Size() (n int)
- func (m Address) String() string
- func (m *Address) Unmarshal(dAtA []byte) error
- func (m *Address) XXX_DiscardUnknown()
- func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Address) XXX_Merge(src proto.Message)
- func (m *Address) XXX_Size() int
- func (m *Address) XXX_Unmarshal(b []byte) error
- type CID
- func (c CID) Bytes() []byte
- func (c CID) Empty() bool
- func (c CID) Equal(cid CID) bool
- func (c CID) Marshal() ([]byte, error)
- func (c CID) MarshalBinary() ([]byte, error)
- func (c *CID) MarshalTo(data []byte) (int, error)
- func (c *CID) Parse(cid string) error
- func (c CID) ProtoMessage()
- func (c *CID) Reset()
- func (c CID) Size() int
- func (c CID) String() string
- func (c *CID) Unmarshal(data []byte) error
- func (c *CID) UnmarshalBinary(data []byte) error
- func (c CID) Verify(data []byte) error
- type MessageID
- type ObjectID
- type OwnerID
- func (o OwnerID) Bytes() []byte
- func (o OwnerID) Empty() bool
- func (o OwnerID) Equal(id OwnerID) bool
- func (o OwnerID) Marshal() ([]byte, error)
- func (o OwnerID) MarshalTo(data []byte) (int, error)
- func (OwnerID) ProtoMessage()
- func (o *OwnerID) Reset()
- func (OwnerID) Size() int
- func (o OwnerID) String() string
- func (o *OwnerID) Unmarshal(data []byte) error
- type SGID
- type UUID
- func (u UUID) Bytes() []byte
- func (u UUID) Empty() bool
- func (u UUID) Equal(u2 UUID) bool
- func (u UUID) Marshal() ([]byte, error)
- func (u UUID) MarshalTo(data []byte) (int, error)
- func (u *UUID) Parse(id string) error
- func (UUID) ProtoMessage()
- func (u *UUID) Reset()
- func (UUID) Size() int
- func (u UUID) String() string
- func (u *UUID) Unmarshal(data []byte) error
Constants ¶
const ( // ErrWrongAddress is raised when wrong address is passed to Address.Parse ParseAddress. ErrWrongAddress = internal.Error("wrong address") // ErrEmptyAddress is raised when empty address is passed to Address.Parse ParseAddress. ErrEmptyAddress = internal.Error("empty address") )
const ( // UUIDSize contains size of UUID. UUIDSize = 16 // SGIDSize contains size of SGID. SGIDSize = UUIDSize // CIDSize contains size of CID. CIDSize = sha256.Size // OwnerIDSize contains size of OwnerID. OwnerIDSize = chain.AddressLength // ErrWrongDataSize is raised when passed bytes into Unmarshal have wrong size. ErrWrongDataSize = internal.Error("wrong data size") // ErrEmptyOwner is raised when empty OwnerID is passed into container.New. ErrEmptyOwner = internal.Error("owner cant be empty") // ErrEmptyCapacity is raised when empty Capacity is passed container.New. ErrEmptyCapacity = internal.Error("capacity cant be empty") // ErrEmptyContainer is raised when it CID method is called for an empty container. ErrEmptyContainer = internal.Error("cannot return ID for empty container") )
Variables ¶
var ( // NewSGID method alias. NewSGID = NewUUID // NewObjectID method alias. NewObjectID = NewUUID // NewMessageID method alias. NewMessageID = NewUUID )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { // ObjectID is an object identifier, valid UUIDv4 represented in bytes ObjectID ObjectID `protobuf:"bytes,1,opt,name=ObjectID,proto3,customtype=ObjectID" json:"ObjectID"` // CID is container identifier CID CID `protobuf:"bytes,2,opt,name=CID,proto3,customtype=CID" json:"CID"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Address of object (container id + object id)
func ParseAddress ¶
ParseAddress parses address from string representation into new Address.
func (*Address) Descriptor ¶
func (*Address) MarshalToSizedBuffer ¶
func (*Address) ProtoMessage ¶
func (*Address) ProtoMessage()
func (*Address) XXX_DiscardUnknown ¶
func (m *Address) XXX_DiscardUnknown()
func (*Address) XXX_Marshal ¶
func (*Address) XXX_Unmarshal ¶
type CID ¶
CID is implementation of ContainerID.
func CIDFromBytes ¶
CIDFromBytes parses CID from passed bytes.
func CIDFromString ¶
CIDFromString parses CID from string representation of CID.
func (CID) MarshalBinary ¶
MarshalBinary returns CID bytes representation.
func (CID) ProtoMessage ¶
func (c CID) ProtoMessage()
ProtoMessage method to satisfy proto.Message interface.
func (*CID) UnmarshalBinary ¶
UnmarshalBinary tries to parse bytes representation of CID.
type OwnerID ¶
type OwnerID chain.WalletAddress
OwnerID is wrapper over neofs-proto/chain.WalletAddress.
func NewOwnerID ¶
NewOwnerID returns generated OwnerID from passed public keys.
func (OwnerID) MarshalTo ¶
MarshalTo copies OwnerID bytes representation into passed slice of bytes.
func (OwnerID) ProtoMessage ¶
func (OwnerID) ProtoMessage()
ProtoMessage method to satisfy proto.Message interface.
type SGID ¶
type SGID = UUID
SGID is type alias of UUID.
func SGIDFromBytes ¶
SGIDFromBytes parse bytes representation of SGID into new SGID value.
type UUID ¶
UUID wrapper over github.com/google/uuid.UUID.
func NewUUID ¶
NewUUID returns a Random (Version 4) UUID.
The strength of the UUIDs is based on the strength of the crypto/rand package.
A note about uniqueness derived from the UUID Wikipedia entry:
Randomly generated UUIDs have 122 random bits. One's annual risk of being hit by a meteorite is estimated to be one chance in 17 billion, that means the probability is about 0.00000000006 (6 × 10−11), equivalent to the odds of creating a few tens of trillions of UUIDs in a year and having one duplicate.