keeper

package
v0.0.0-...-5dfe74e Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 23 Imported by: 3

Documentation

Index

Constants

View Source
const (
	SizeData255  = 183  // defines max length of byte slice which can be encoded into Data ERN under 255  bytes
	SizeData1023 = 759  // defines max length of byte slice which can be encoded into Data ERN under 1023 bytes
	SizeData5119 = 3831 // defines max length of byte slice which can be encoded into Data ERN under 5119 bytes
)
View Source
const (
	Keeper_CreateObject_FullMethodName            = "/eolymp.keeper.Keeper/CreateObject"
	Keeper_DescribeObject_FullMethodName          = "/eolymp.keeper.Keeper/DescribeObject"
	Keeper_DownloadObject_FullMethodName          = "/eolymp.keeper.Keeper/DownloadObject"
	Keeper_StartMultipartUpload_FullMethodName    = "/eolymp.keeper.Keeper/StartMultipartUpload"
	Keeper_UploadPart_FullMethodName              = "/eolymp.keeper.Keeper/UploadPart"
	Keeper_CompleteMultipartUpload_FullMethodName = "/eolymp.keeper.Keeper/CompleteMultipartUpload"
)

Variables

View Source
var File_eolymp_keeper_blob_proto protoreflect.FileDescriptor
View Source
var File_eolymp_keeper_keeper_proto protoreflect.FileDescriptor
View Source
var Keeper_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "eolymp.keeper.Keeper",
	HandlerType: (*KeeperServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateObject",
			Handler:    _Keeper_CreateObject_Handler,
		},
		{
			MethodName: "DescribeObject",
			Handler:    _Keeper_DescribeObject_Handler,
		},
		{
			MethodName: "DownloadObject",
			Handler:    _Keeper_DownloadObject_Handler,
		},
		{
			MethodName: "StartMultipartUpload",
			Handler:    _Keeper_StartMultipartUpload_Handler,
		},
		{
			MethodName: "UploadPart",
			Handler:    _Keeper_UploadPart_Handler,
		},
		{
			MethodName: "CompleteMultipartUpload",
			Handler:    _Keeper_CompleteMultipartUpload_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "eolymp/keeper/keeper.proto",
}

Keeper_ServiceDesc is the grpc.ServiceDesc for Keeper service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func FormatBlobErn

func FormatBlobErn(blobKey string) ern.Name

func FormatDataErn

func FormatDataErn(data []byte) ern.Name

func IsBlobErn

func IsBlobErn(e ern.Name) bool

func IsDataErn

func IsDataErn(e ern.Name) bool

func ParseBlobErn

func ParseBlobErn(e ern.Name) (string, bool)

func ParseDataErn

func ParseDataErn(e ern.Name) ([]byte, bool)

func RegisterKeeperHttpHandlers

func RegisterKeeperHttpHandlers(router *mux.Router, prefix string, cli KeeperClient)

RegisterKeeperHttpHandlers adds handlers for for KeeperClient This constructor creates http.Handler, the actual implementation might change at any moment

func RegisterKeeperServer

func RegisterKeeperServer(s grpc.ServiceRegistrar, srv KeeperServer)

Types

type Blob

type Blob struct {
	Ern  string `protobuf:"bytes,1,opt,name=ern,proto3" json:"ern,omitempty"`
	Key  string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`    // Unique identifier of the blob
	Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`  // SHA1 hash of data
	Size uint32 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // Size of the data
	Data []byte `protobuf:"bytes,100,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Blob) Descriptor deprecated

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

Deprecated: Use Blob.ProtoReflect.Descriptor instead.

func (*Blob) GetData

func (x *Blob) GetData() []byte

func (*Blob) GetErn

func (x *Blob) GetErn() string

func (*Blob) GetHash

func (x *Blob) GetHash() string

func (*Blob) GetKey

func (x *Blob) GetKey() string

func (*Blob) GetSize

func (x *Blob) GetSize() uint32

func (*Blob) ProtoMessage

func (*Blob) ProtoMessage()

func (*Blob) ProtoReflect

func (x *Blob) ProtoReflect() protoreflect.Message

func (*Blob) Reset

func (x *Blob) Reset()

func (*Blob) String

func (x *Blob) String() string

type CompleteMultipartUploadInput

type CompleteMultipartUploadInput struct {
	ObjectId string                               `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	UploadId string                               `protobuf:"bytes,2,opt,name=upload_id,json=uploadId,proto3" json:"upload_id,omitempty"`
	Parts    []*CompleteMultipartUploadInput_Part `protobuf:"bytes,10,rep,name=parts,proto3" json:"parts,omitempty"`
	// contains filtered or unexported fields
}

func (*CompleteMultipartUploadInput) Descriptor deprecated

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

Deprecated: Use CompleteMultipartUploadInput.ProtoReflect.Descriptor instead.

func (*CompleteMultipartUploadInput) GetObjectId

func (x *CompleteMultipartUploadInput) GetObjectId() string

func (*CompleteMultipartUploadInput) GetParts

func (*CompleteMultipartUploadInput) GetUploadId

func (x *CompleteMultipartUploadInput) GetUploadId() string

func (*CompleteMultipartUploadInput) ProtoMessage

func (*CompleteMultipartUploadInput) ProtoMessage()

func (*CompleteMultipartUploadInput) ProtoReflect

func (*CompleteMultipartUploadInput) Reset

func (x *CompleteMultipartUploadInput) Reset()

func (*CompleteMultipartUploadInput) String

type CompleteMultipartUploadInput_Part

type CompleteMultipartUploadInput_Part struct {
	Number       uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	Etag         string `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"`
	ChecksumSha1 string `protobuf:"bytes,10,opt,name=checksum_sha1,json=checksumSha1,proto3" json:"checksum_sha1,omitempty"`
	// contains filtered or unexported fields
}

func (*CompleteMultipartUploadInput_Part) Descriptor deprecated

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

Deprecated: Use CompleteMultipartUploadInput_Part.ProtoReflect.Descriptor instead.

func (*CompleteMultipartUploadInput_Part) GetChecksumSha1

func (x *CompleteMultipartUploadInput_Part) GetChecksumSha1() string

func (*CompleteMultipartUploadInput_Part) GetEtag

func (*CompleteMultipartUploadInput_Part) GetNumber

func (*CompleteMultipartUploadInput_Part) ProtoMessage

func (*CompleteMultipartUploadInput_Part) ProtoMessage()

func (*CompleteMultipartUploadInput_Part) ProtoReflect

func (*CompleteMultipartUploadInput_Part) Reset

func (*CompleteMultipartUploadInput_Part) String

type CompleteMultipartUploadOutput

type CompleteMultipartUploadOutput struct {
	// contains filtered or unexported fields
}

func (*CompleteMultipartUploadOutput) Descriptor deprecated

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

Deprecated: Use CompleteMultipartUploadOutput.ProtoReflect.Descriptor instead.

func (*CompleteMultipartUploadOutput) ProtoMessage

func (*CompleteMultipartUploadOutput) ProtoMessage()

func (*CompleteMultipartUploadOutput) ProtoReflect

func (*CompleteMultipartUploadOutput) Reset

func (x *CompleteMultipartUploadOutput) Reset()

func (*CompleteMultipartUploadOutput) String

type CreateObjectInput

type CreateObjectInput struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateObjectInput) Descriptor deprecated

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

Deprecated: Use CreateObjectInput.ProtoReflect.Descriptor instead.

func (*CreateObjectInput) GetData

func (x *CreateObjectInput) GetData() []byte

func (*CreateObjectInput) ProtoMessage

func (*CreateObjectInput) ProtoMessage()

func (*CreateObjectInput) ProtoReflect

func (x *CreateObjectInput) ProtoReflect() protoreflect.Message

func (*CreateObjectInput) Reset

func (x *CreateObjectInput) Reset()

func (*CreateObjectInput) String

func (x *CreateObjectInput) String() string

type CreateObjectOutput

type CreateObjectOutput struct {
	Key      string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	BlobErn  string `protobuf:"bytes,2,opt,name=blob_ern,json=blobErn,proto3" json:"blob_ern,omitempty"`    // deprecated
	BlobHash string `protobuf:"bytes,3,opt,name=blob_hash,json=blobHash,proto3" json:"blob_hash,omitempty"` // SHA1 hash of data
	Url      string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateObjectOutput) Descriptor deprecated

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

Deprecated: Use CreateObjectOutput.ProtoReflect.Descriptor instead.

func (*CreateObjectOutput) GetBlobErn

func (x *CreateObjectOutput) GetBlobErn() string

func (*CreateObjectOutput) GetBlobHash

func (x *CreateObjectOutput) GetBlobHash() string

func (*CreateObjectOutput) GetKey

func (x *CreateObjectOutput) GetKey() string

func (*CreateObjectOutput) GetUrl

func (x *CreateObjectOutput) GetUrl() string

func (*CreateObjectOutput) ProtoMessage

func (*CreateObjectOutput) ProtoMessage()

func (*CreateObjectOutput) ProtoReflect

func (x *CreateObjectOutput) ProtoReflect() protoreflect.Message

func (*CreateObjectOutput) Reset

func (x *CreateObjectOutput) Reset()

func (*CreateObjectOutput) String

func (x *CreateObjectOutput) String() string

type DescribeObjectInput

type DescribeObjectInput struct {
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*DescribeObjectInput) Descriptor deprecated

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

Deprecated: Use DescribeObjectInput.ProtoReflect.Descriptor instead.

func (*DescribeObjectInput) GetKey

func (x *DescribeObjectInput) GetKey() string

func (*DescribeObjectInput) ProtoMessage

func (*DescribeObjectInput) ProtoMessage()

func (*DescribeObjectInput) ProtoReflect

func (x *DescribeObjectInput) ProtoReflect() protoreflect.Message

func (*DescribeObjectInput) Reset

func (x *DescribeObjectInput) Reset()

func (*DescribeObjectInput) String

func (x *DescribeObjectInput) String() string

type DescribeObjectOutput

type DescribeObjectOutput struct {

	// Object total size.
	Size int32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*DescribeObjectOutput) Descriptor deprecated

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

Deprecated: Use DescribeObjectOutput.ProtoReflect.Descriptor instead.

func (*DescribeObjectOutput) GetSize

func (x *DescribeObjectOutput) GetSize() int32

func (*DescribeObjectOutput) ProtoMessage

func (*DescribeObjectOutput) ProtoMessage()

func (*DescribeObjectOutput) ProtoReflect

func (x *DescribeObjectOutput) ProtoReflect() protoreflect.Message

func (*DescribeObjectOutput) Reset

func (x *DescribeObjectOutput) Reset()

func (*DescribeObjectOutput) String

func (x *DescribeObjectOutput) String() string

type DownloadObjectInput

type DownloadObjectInput struct {

	// Object key.
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// Receive data starting at "offset" bytes.
	Offset int32 `protobuf:"varint,10,opt,name=offset,proto3" json:"offset,omitempty"`
	// Maximum amount of data to be received.
	Size int32 `protobuf:"varint,11,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*DownloadObjectInput) Descriptor deprecated

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

Deprecated: Use DownloadObjectInput.ProtoReflect.Descriptor instead.

func (*DownloadObjectInput) GetKey

func (x *DownloadObjectInput) GetKey() string

func (*DownloadObjectInput) GetOffset

func (x *DownloadObjectInput) GetOffset() int32

func (*DownloadObjectInput) GetSize

func (x *DownloadObjectInput) GetSize() int32

func (*DownloadObjectInput) ProtoMessage

func (*DownloadObjectInput) ProtoMessage()

func (*DownloadObjectInput) ProtoReflect

func (x *DownloadObjectInput) ProtoReflect() protoreflect.Message

func (*DownloadObjectInput) Reset

func (x *DownloadObjectInput) Reset()

func (*DownloadObjectInput) String

func (x *DownloadObjectInput) String() string

type DownloadObjectOutput

type DownloadObjectOutput struct {

	// Object data.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// Object total size.
	Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*DownloadObjectOutput) Descriptor deprecated

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

Deprecated: Use DownloadObjectOutput.ProtoReflect.Descriptor instead.

func (*DownloadObjectOutput) GetData

func (x *DownloadObjectOutput) GetData() []byte

func (*DownloadObjectOutput) GetSize

func (x *DownloadObjectOutput) GetSize() int32

func (*DownloadObjectOutput) ProtoMessage

func (*DownloadObjectOutput) ProtoMessage()

func (*DownloadObjectOutput) ProtoReflect

func (x *DownloadObjectOutput) ProtoReflect() protoreflect.Message

func (*DownloadObjectOutput) Reset

func (x *DownloadObjectOutput) Reset()

func (*DownloadObjectOutput) String

func (x *DownloadObjectOutput) String() string

type KeeperClient

type KeeperClient interface {
	CreateObject(ctx context.Context, in *CreateObjectInput, opts ...grpc.CallOption) (*CreateObjectOutput, error)
	DescribeObject(ctx context.Context, in *DescribeObjectInput, opts ...grpc.CallOption) (*DescribeObjectOutput, error)
	DownloadObject(ctx context.Context, in *DownloadObjectInput, opts ...grpc.CallOption) (*DownloadObjectOutput, error)
	StartMultipartUpload(ctx context.Context, in *StartMultipartUploadInput, opts ...grpc.CallOption) (*StartMultipartUploadOutput, error)
	UploadPart(ctx context.Context, in *UploadPartInput, opts ...grpc.CallOption) (*UploadPartOutput, error)
	CompleteMultipartUpload(ctx context.Context, in *CompleteMultipartUploadInput, opts ...grpc.CallOption) (*CompleteMultipartUploadOutput, error)
}

KeeperClient is the client API for Keeper service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewKeeperClient

func NewKeeperClient(cc grpc.ClientConnInterface) KeeperClient

type KeeperInterceptor

type KeeperInterceptor struct {
	// contains filtered or unexported fields
}

func NewKeeperInterceptor

func NewKeeperInterceptor(cli KeeperClient, middleware ..._KeeperMiddleware) *KeeperInterceptor

NewKeeperInterceptor constructs additional middleware for a server based on annotations in proto files

func (*KeeperInterceptor) CompleteMultipartUpload

func (*KeeperInterceptor) CreateObject

func (*KeeperInterceptor) DescribeObject

func (*KeeperInterceptor) DownloadObject

func (*KeeperInterceptor) StartMultipartUpload

func (*KeeperInterceptor) UploadPart

type KeeperServer

KeeperServer is the server API for Keeper service. All implementations should embed UnimplementedKeeperServer for forward compatibility

type KeeperService

type KeeperService struct {
	// contains filtered or unexported fields
}

func NewKeeperHttpClient

func NewKeeperHttpClient(url string, cli _KeeperHttpClient) *KeeperService

NewKeeperHttpClient constructs client for Keeper

func (*KeeperService) CompleteMultipartUpload

func (*KeeperService) CreateObject

func (*KeeperService) DescribeObject

func (*KeeperService) DownloadObject

func (*KeeperService) StartMultipartUpload

func (*KeeperService) UploadPart

func (s *KeeperService) UploadPart(ctx context.Context, in *UploadPartInput) (*UploadPartOutput, error)

type StartMultipartUploadInput

type StartMultipartUploadInput struct {
	// contains filtered or unexported fields
}

func (*StartMultipartUploadInput) Descriptor deprecated

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

Deprecated: Use StartMultipartUploadInput.ProtoReflect.Descriptor instead.

func (*StartMultipartUploadInput) ProtoMessage

func (*StartMultipartUploadInput) ProtoMessage()

func (*StartMultipartUploadInput) ProtoReflect

func (*StartMultipartUploadInput) Reset

func (x *StartMultipartUploadInput) Reset()

func (*StartMultipartUploadInput) String

func (x *StartMultipartUploadInput) String() string

type StartMultipartUploadOutput

type StartMultipartUploadOutput struct {
	ObjectId string `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	UploadId string `protobuf:"bytes,2,opt,name=upload_id,json=uploadId,proto3" json:"upload_id,omitempty"`
	// contains filtered or unexported fields
}

func (*StartMultipartUploadOutput) Descriptor deprecated

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

Deprecated: Use StartMultipartUploadOutput.ProtoReflect.Descriptor instead.

func (*StartMultipartUploadOutput) GetObjectId

func (x *StartMultipartUploadOutput) GetObjectId() string

func (*StartMultipartUploadOutput) GetUploadId

func (x *StartMultipartUploadOutput) GetUploadId() string

func (*StartMultipartUploadOutput) ProtoMessage

func (*StartMultipartUploadOutput) ProtoMessage()

func (*StartMultipartUploadOutput) ProtoReflect

func (*StartMultipartUploadOutput) Reset

func (x *StartMultipartUploadOutput) Reset()

func (*StartMultipartUploadOutput) String

func (x *StartMultipartUploadOutput) String() string

type UnimplementedKeeperServer

type UnimplementedKeeperServer struct {
}

UnimplementedKeeperServer should be embedded to have forward compatible implementations.

func (UnimplementedKeeperServer) CreateObject

func (UnimplementedKeeperServer) DescribeObject

func (UnimplementedKeeperServer) DownloadObject

func (UnimplementedKeeperServer) UploadPart

type UnsafeKeeperServer

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

UnsafeKeeperServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to KeeperServer will result in compilation errors.

type UploadPartInput

type UploadPartInput struct {
	ObjectId   string `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
	UploadId   string `protobuf:"bytes,2,opt,name=upload_id,json=uploadId,proto3" json:"upload_id,omitempty"`
	PartNumber uint32 `protobuf:"varint,3,opt,name=part_number,json=partNumber,proto3" json:"part_number,omitempty"`
	Data       []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadPartInput) Descriptor deprecated

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

Deprecated: Use UploadPartInput.ProtoReflect.Descriptor instead.

func (*UploadPartInput) GetData

func (x *UploadPartInput) GetData() []byte

func (*UploadPartInput) GetObjectId

func (x *UploadPartInput) GetObjectId() string

func (*UploadPartInput) GetPartNumber

func (x *UploadPartInput) GetPartNumber() uint32

func (*UploadPartInput) GetUploadId

func (x *UploadPartInput) GetUploadId() string

func (*UploadPartInput) ProtoMessage

func (*UploadPartInput) ProtoMessage()

func (*UploadPartInput) ProtoReflect

func (x *UploadPartInput) ProtoReflect() protoreflect.Message

func (*UploadPartInput) Reset

func (x *UploadPartInput) Reset()

func (*UploadPartInput) String

func (x *UploadPartInput) String() string

type UploadPartOutput

type UploadPartOutput struct {
	Etag string `protobuf:"bytes,1,opt,name=etag,proto3" json:"etag,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadPartOutput) Descriptor deprecated

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

Deprecated: Use UploadPartOutput.ProtoReflect.Descriptor instead.

func (*UploadPartOutput) GetEtag

func (x *UploadPartOutput) GetEtag() string

func (*UploadPartOutput) ProtoMessage

func (*UploadPartOutput) ProtoMessage()

func (*UploadPartOutput) ProtoReflect

func (x *UploadPartOutput) ProtoReflect() protoreflect.Message

func (*UploadPartOutput) Reset

func (x *UploadPartOutput) Reset()

func (*UploadPartOutput) String

func (x *UploadPartOutput) String() string

Jump to

Keyboard shortcuts

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