container

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrNotFound is raised when container could not be found.
	ErrNotFound = internal.Error("could not find container")
)

Variables

View Source
var (
	ErrInvalidLengthService        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowService          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterServiceServer

func RegisterServiceServer(s *grpc.Server, srv ServiceServer)

Types

type CID

type CID = refs.CID

CID type alias.

type Container

type Container struct {
	// OwnerID is a wallet address.
	OwnerID OwnerID `protobuf:"bytes,1,opt,name=OwnerID,proto3,customtype=OwnerID" json:"OwnerID"`
	// Salt is a nonce for unique container id calculation.
	Salt UUID `protobuf:"bytes,2,opt,name=Salt,proto3,customtype=UUID" json:"Salt"`
	// Capacity defines amount of data that can be stored in the container (doesn't used for now).
	Capacity uint64 `protobuf:"varint,3,opt,name=Capacity,proto3" json:"Capacity,omitempty"`
	// Rules define storage policy for the object inside the container.
	Rules netmap.PlacementRule `protobuf:"bytes,4,opt,name=Rules,proto3" json:"Rules"`
	// BasicACL with access control rules for owner, system, others and
	// permission bits for bearer token and extended ACL.
	BasicACL             uint32   `protobuf:"varint,5,opt,name=BasicACL,proto3" json:"BasicACL,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The Container service definition.

func New

func New(cap uint64, owner OwnerID, acl uint32, rules netmap.PlacementRule) (*Container, error)

New creates new user container based on capacity, OwnerID, ACL and PlacementRules.

func NewTestContainer

func NewTestContainer() (*Container, error)

NewTestContainer returns test container. WARNING: DON'T USE THIS OUTSIDE TESTS.

func (*Container) Bytes

func (m *Container) Bytes() []byte

Bytes returns bytes representation of Container.

func (*Container) Descriptor

func (*Container) Descriptor() ([]byte, []int)

func (*Container) Empty

func (m *Container) Empty() bool

Empty checks that container is empty.

func (*Container) GetBasicACL added in v0.6.0

func (m *Container) GetBasicACL() uint32

func (*Container) GetCapacity

func (m *Container) GetCapacity() uint64

func (*Container) GetRules

func (m *Container) GetRules() netmap.PlacementRule

func (*Container) ID

func (m *Container) ID() (CID, error)

ID returns generated ContainerID based on Container (data).

func (*Container) Marshal

func (m *Container) Marshal() (dAtA []byte, err error)

func (*Container) MarshalTo

func (m *Container) MarshalTo(dAtA []byte) (int, error)

func (*Container) MarshalToSizedBuffer

func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Container) ProtoMessage

func (*Container) ProtoMessage()

func (*Container) Reset

func (m *Container) Reset()

func (*Container) Size

func (m *Container) Size() (n int)

func (*Container) String

func (m *Container) String() string

func (*Container) Unmarshal

func (m *Container) Unmarshal(dAtA []byte) error

func (*Container) XXX_DiscardUnknown

func (m *Container) XXX_DiscardUnknown()

func (*Container) XXX_Marshal

func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Container) XXX_Merge

func (m *Container) XXX_Merge(src proto.Message)

func (*Container) XXX_Size

func (m *Container) XXX_Size() int

func (*Container) XXX_Unmarshal

func (m *Container) XXX_Unmarshal(b []byte) error

type DeleteRequest

type DeleteRequest struct {
	// CID (container id) is a SHA256 hash of the container structure
	CID CID `protobuf:"bytes,1,opt,name=CID,proto3,customtype=CID" json:"CID"`
	// RequestMetaHeader contains information about request meta headers (should be embedded into message)
	service.RequestMetaHeader `protobuf:"bytes,98,opt,name=Meta,proto3,embedded=Meta" json:"Meta"`
	// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
	service.RequestVerificationHeader `protobuf:"bytes,99,opt,name=Verify,proto3,embedded=Verify" json:"Verify"`
	XXX_NoUnkeyedLiteral              struct{} `json:"-"`
	XXX_unrecognized                  []byte   `json:"-"`
	XXX_sizecache                     int32    `json:"-"`
}

func (*DeleteRequest) Descriptor

func (*DeleteRequest) Descriptor() ([]byte, []int)

func (*DeleteRequest) Marshal

func (m *DeleteRequest) Marshal() (dAtA []byte, err error)

func (*DeleteRequest) MarshalTo

func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error)

func (*DeleteRequest) MarshalToSizedBuffer

func (m *DeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeleteRequest) PrepareData

func (m *DeleteRequest) PrepareData() ([]byte, error)

PrepareData prepares bytes representation of DeleteRequest to satisfy SignedRequest interface.

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) Reset

func (m *DeleteRequest) Reset()

func (*DeleteRequest) Size

func (m *DeleteRequest) Size() (n int)

func (*DeleteRequest) String

func (m *DeleteRequest) String() string

func (*DeleteRequest) Unmarshal

func (m *DeleteRequest) Unmarshal(dAtA []byte) error

func (*DeleteRequest) XXX_DiscardUnknown

func (m *DeleteRequest) XXX_DiscardUnknown()

func (*DeleteRequest) XXX_Marshal

func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteRequest) XXX_Merge

func (m *DeleteRequest) XXX_Merge(src proto.Message)

func (*DeleteRequest) XXX_Size

func (m *DeleteRequest) XXX_Size() int

func (*DeleteRequest) XXX_Unmarshal

func (m *DeleteRequest) XXX_Unmarshal(b []byte) error

type DeleteResponse

type DeleteResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

DeleteResponse is empty because delete operation is asynchronous and done via consensus in inner ring nodes

func (*DeleteResponse) Descriptor

func (*DeleteResponse) Descriptor() ([]byte, []int)

func (*DeleteResponse) Marshal

func (m *DeleteResponse) Marshal() (dAtA []byte, err error)

func (*DeleteResponse) MarshalTo

func (m *DeleteResponse) MarshalTo(dAtA []byte) (int, error)

func (*DeleteResponse) MarshalToSizedBuffer

func (m *DeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) Reset

func (m *DeleteResponse) Reset()

func (*DeleteResponse) Size

func (m *DeleteResponse) Size() (n int)

func (*DeleteResponse) String

func (m *DeleteResponse) String() string

func (*DeleteResponse) Unmarshal

func (m *DeleteResponse) Unmarshal(dAtA []byte) error

func (*DeleteResponse) XXX_DiscardUnknown

func (m *DeleteResponse) XXX_DiscardUnknown()

func (*DeleteResponse) XXX_Marshal

func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteResponse) XXX_Merge

func (m *DeleteResponse) XXX_Merge(src proto.Message)

func (*DeleteResponse) XXX_Size

func (m *DeleteResponse) XXX_Size() int

func (*DeleteResponse) XXX_Unmarshal

func (m *DeleteResponse) XXX_Unmarshal(b []byte) error

type GetRequest

type GetRequest struct {
	// CID (container id) is a SHA256 hash of the container structure
	CID CID `protobuf:"bytes,1,opt,name=CID,proto3,customtype=CID" json:"CID"`
	// RequestMetaHeader contains information about request meta headers (should be embedded into message)
	service.RequestMetaHeader `protobuf:"bytes,98,opt,name=Meta,proto3,embedded=Meta" json:"Meta"`
	// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
	service.RequestVerificationHeader `protobuf:"bytes,99,opt,name=Verify,proto3,embedded=Verify" json:"Verify"`
	XXX_NoUnkeyedLiteral              struct{} `json:"-"`
	XXX_unrecognized                  []byte   `json:"-"`
	XXX_sizecache                     int32    `json:"-"`
}

func (*GetRequest) Descriptor

func (*GetRequest) Descriptor() ([]byte, []int)

func (*GetRequest) Marshal

func (m *GetRequest) Marshal() (dAtA []byte, err error)

func (*GetRequest) MarshalTo

func (m *GetRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetRequest) MarshalToSizedBuffer

func (m *GetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) Size

func (m *GetRequest) Size() (n int)

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) Unmarshal

func (m *GetRequest) Unmarshal(dAtA []byte) error

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRequest) XXX_Merge

func (m *GetRequest) XXX_Merge(src proto.Message)

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

func (m *GetRequest) XXX_Unmarshal(b []byte) error

type GetResponse

type GetResponse struct {
	// Container is a structure that contains placement rules and owner id
	Container            *Container `protobuf:"bytes,1,opt,name=Container,proto3" json:"Container,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*GetResponse) Descriptor

func (*GetResponse) Descriptor() ([]byte, []int)

func (*GetResponse) GetContainer

func (m *GetResponse) GetContainer() *Container

func (*GetResponse) Marshal

func (m *GetResponse) Marshal() (dAtA []byte, err error)

func (*GetResponse) MarshalTo

func (m *GetResponse) MarshalTo(dAtA []byte) (int, error)

func (*GetResponse) MarshalToSizedBuffer

func (m *GetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) Size

func (m *GetResponse) Size() (n int)

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) Unmarshal

func (m *GetResponse) Unmarshal(dAtA []byte) error

func (*GetResponse) XXX_DiscardUnknown

func (m *GetResponse) XXX_DiscardUnknown()

func (*GetResponse) XXX_Marshal

func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetResponse) XXX_Merge

func (m *GetResponse) XXX_Merge(src proto.Message)

func (*GetResponse) XXX_Size

func (m *GetResponse) XXX_Size() int

func (*GetResponse) XXX_Unmarshal

func (m *GetResponse) XXX_Unmarshal(b []byte) error

type ListRequest

type ListRequest struct {
	// OwnerID is a wallet address
	OwnerID OwnerID `protobuf:"bytes,1,opt,name=OwnerID,proto3,customtype=OwnerID" json:"OwnerID"`
	// RequestMetaHeader contains information about request meta headers (should be embedded into message)
	service.RequestMetaHeader `protobuf:"bytes,98,opt,name=Meta,proto3,embedded=Meta" json:"Meta"`
	// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
	service.RequestVerificationHeader `protobuf:"bytes,99,opt,name=Verify,proto3,embedded=Verify" json:"Verify"`
	XXX_NoUnkeyedLiteral              struct{} `json:"-"`
	XXX_unrecognized                  []byte   `json:"-"`
	XXX_sizecache                     int32    `json:"-"`
}

func (*ListRequest) Descriptor

func (*ListRequest) Descriptor() ([]byte, []int)

func (*ListRequest) Marshal

func (m *ListRequest) Marshal() (dAtA []byte, err error)

func (*ListRequest) MarshalTo

func (m *ListRequest) MarshalTo(dAtA []byte) (int, error)

func (*ListRequest) MarshalToSizedBuffer

func (m *ListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset

func (m *ListRequest) Reset()

func (*ListRequest) Size

func (m *ListRequest) Size() (n int)

func (*ListRequest) String

func (m *ListRequest) String() string

func (*ListRequest) Unmarshal

func (m *ListRequest) Unmarshal(dAtA []byte) error

func (*ListRequest) XXX_DiscardUnknown

func (m *ListRequest) XXX_DiscardUnknown()

func (*ListRequest) XXX_Marshal

func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListRequest) XXX_Merge

func (m *ListRequest) XXX_Merge(src proto.Message)

func (*ListRequest) XXX_Size

func (m *ListRequest) XXX_Size() int

func (*ListRequest) XXX_Unmarshal

func (m *ListRequest) XXX_Unmarshal(b []byte) error

type ListResponse

type ListResponse struct {
	// CID (container id) is list of SHA256 hashes of the container structures
	CID                  []CID    `protobuf:"bytes,1,rep,name=CID,proto3,customtype=CID" json:"CID"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListResponse) Descriptor

func (*ListResponse) Descriptor() ([]byte, []int)

func (*ListResponse) Marshal

func (m *ListResponse) Marshal() (dAtA []byte, err error)

func (*ListResponse) MarshalTo

func (m *ListResponse) MarshalTo(dAtA []byte) (int, error)

func (*ListResponse) MarshalToSizedBuffer

func (m *ListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) Reset

func (m *ListResponse) Reset()

func (*ListResponse) Size

func (m *ListResponse) Size() (n int)

func (*ListResponse) String

func (m *ListResponse) String() string

func (*ListResponse) Unmarshal

func (m *ListResponse) Unmarshal(dAtA []byte) error

func (*ListResponse) XXX_DiscardUnknown

func (m *ListResponse) XXX_DiscardUnknown()

func (*ListResponse) XXX_Marshal

func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListResponse) XXX_Merge

func (m *ListResponse) XXX_Merge(src proto.Message)

func (*ListResponse) XXX_Size

func (m *ListResponse) XXX_Size() int

func (*ListResponse) XXX_Unmarshal

func (m *ListResponse) XXX_Unmarshal(b []byte) error

type MessageID

type MessageID = refs.MessageID

MessageID type alias.

type OwnerID

type OwnerID = refs.OwnerID

OwnerID type alias.

type PutRequest

type PutRequest struct {
	// MessageID is a nonce for uniq container id calculation
	MessageID MessageID `protobuf:"bytes,1,opt,name=MessageID,proto3,customtype=MessageID" json:"MessageID"`
	// Capacity defines amount of data that can be stored in the container (doesn't used for now).
	Capacity uint64 `protobuf:"varint,2,opt,name=Capacity,proto3" json:"Capacity,omitempty"`
	// OwnerID is a wallet address
	OwnerID OwnerID `protobuf:"bytes,3,opt,name=OwnerID,proto3,customtype=OwnerID" json:"OwnerID"`
	// Rules define storage policy for the object inside the container.
	Rules netmap.PlacementRule `protobuf:"bytes,4,opt,name=rules,proto3" json:"rules"`
	// BasicACL of the container.
	BasicACL uint32 `protobuf:"varint,5,opt,name=BasicACL,proto3" json:"BasicACL,omitempty"`
	// RequestMetaHeader contains information about request meta headers (should be embedded into message)
	service.RequestMetaHeader `protobuf:"bytes,98,opt,name=Meta,proto3,embedded=Meta" json:"Meta"`
	// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
	service.RequestVerificationHeader `protobuf:"bytes,99,opt,name=Verify,proto3,embedded=Verify" json:"Verify"`
	XXX_NoUnkeyedLiteral              struct{} `json:"-"`
	XXX_unrecognized                  []byte   `json:"-"`
	XXX_sizecache                     int32    `json:"-"`
}

func (*PutRequest) Descriptor

func (*PutRequest) Descriptor() ([]byte, []int)

func (*PutRequest) GetBasicACL added in v0.6.0

func (m *PutRequest) GetBasicACL() uint32

func (*PutRequest) GetCapacity

func (m *PutRequest) GetCapacity() uint64

func (*PutRequest) GetRules

func (m *PutRequest) GetRules() netmap.PlacementRule

func (*PutRequest) Marshal

func (m *PutRequest) Marshal() (dAtA []byte, err error)

func (*PutRequest) MarshalTo

func (m *PutRequest) MarshalTo(dAtA []byte) (int, error)

func (*PutRequest) MarshalToSizedBuffer

func (m *PutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PutRequest) PrepareData

func (m *PutRequest) PrepareData() ([]byte, error)

PrepareData prepares bytes representation of PutRequest to satisfy SignedRequest interface.

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) Reset

func (m *PutRequest) Reset()

func (*PutRequest) Size

func (m *PutRequest) Size() (n int)

func (*PutRequest) String

func (m *PutRequest) String() string

func (*PutRequest) Unmarshal

func (m *PutRequest) Unmarshal(dAtA []byte) error

func (*PutRequest) XXX_DiscardUnknown

func (m *PutRequest) XXX_DiscardUnknown()

func (*PutRequest) XXX_Marshal

func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PutRequest) XXX_Merge

func (m *PutRequest) XXX_Merge(src proto.Message)

func (*PutRequest) XXX_Size

func (m *PutRequest) XXX_Size() int

func (*PutRequest) XXX_Unmarshal

func (m *PutRequest) XXX_Unmarshal(b []byte) error

type PutResponse

type PutResponse struct {
	// CID (container id) is a SHA256 hash of the container structure
	CID                  CID      `protobuf:"bytes,1,opt,name=CID,proto3,customtype=CID" json:"CID"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PutResponse) Descriptor

func (*PutResponse) Descriptor() ([]byte, []int)

func (*PutResponse) Marshal

func (m *PutResponse) Marshal() (dAtA []byte, err error)

func (*PutResponse) MarshalTo

func (m *PutResponse) MarshalTo(dAtA []byte) (int, error)

func (*PutResponse) MarshalToSizedBuffer

func (m *PutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) Reset

func (m *PutResponse) Reset()

func (*PutResponse) Size

func (m *PutResponse) Size() (n int)

func (*PutResponse) String

func (m *PutResponse) String() string

func (*PutResponse) Unmarshal

func (m *PutResponse) Unmarshal(dAtA []byte) error

func (*PutResponse) XXX_DiscardUnknown

func (m *PutResponse) XXX_DiscardUnknown()

func (*PutResponse) XXX_Marshal

func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PutResponse) XXX_Merge

func (m *PutResponse) XXX_Merge(src proto.Message)

func (*PutResponse) XXX_Size

func (m *PutResponse) XXX_Size() int

func (*PutResponse) XXX_Unmarshal

func (m *PutResponse) XXX_Unmarshal(b []byte) error

type ServiceClient

type ServiceClient interface {
	// Put request proposes container to the inner ring nodes. They will
	// accept new container if user has enough deposit. All containers
	// are accepted by the consensus, therefore it is asynchronous process.
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
	// Delete container removes it from the inner ring container storage. It
	// also asynchronous process done by consensus.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	// Get container returns container instance
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// List returns all user's containers
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewServiceClient

func NewServiceClient(cc *grpc.ClientConn) ServiceClient

type ServiceServer

type ServiceServer interface {
	// Put request proposes container to the inner ring nodes. They will
	// accept new container if user has enough deposit. All containers
	// are accepted by the consensus, therefore it is asynchronous process.
	Put(context.Context, *PutRequest) (*PutResponse, error)
	// Delete container removes it from the inner ring container storage. It
	// also asynchronous process done by consensus.
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	// Get container returns container instance
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// List returns all user's containers
	List(context.Context, *ListRequest) (*ListResponse, error)
}

ServiceServer is the server API for Service service.

type UUID

type UUID = refs.UUID

UUID type alias.

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) Delete

func (*UnimplementedServiceServer) Get

func (*UnimplementedServiceServer) List

func (*UnimplementedServiceServer) Put

Jump to

Keyboard shortcuts

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