upload

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package upload contains

Index

Constants

This section is empty.

Variables

View Source
var File_upload_proto protoreflect.FileDescriptor

Functions

func RegisterUploadsServer

func RegisterUploadsServer(s grpc.ServiceRegistrar, srv UploadsServer)

Types

type BeginRequest

type BeginRequest struct {
	Tenant *tenant.ID `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	Path   string     `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// For trivially small (or empty) files, we'd like to be able to
	// effect the transfer in a single request.
	//
	// Types that are assignable to Committed:
	//	*BeginRequest_Contents
	//	*BeginRequest_Empty
	Committed isBeginRequest_Committed `protobuf_oneof:"committed"`
	// contains filtered or unexported fields
}

func (*BeginRequest) Descriptor deprecated

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

Deprecated: Use BeginRequest.ProtoReflect.Descriptor instead.

func (*BeginRequest) GetCommitted

func (m *BeginRequest) GetCommitted() isBeginRequest_Committed

func (*BeginRequest) GetContents

func (x *BeginRequest) GetContents() []byte

func (*BeginRequest) GetEmpty

func (x *BeginRequest) GetEmpty() bool

func (*BeginRequest) GetPath

func (x *BeginRequest) GetPath() string

func (*BeginRequest) GetTenant

func (x *BeginRequest) GetTenant() *tenant.ID

func (*BeginRequest) ProtoMessage

func (*BeginRequest) ProtoMessage()

func (*BeginRequest) ProtoReflect

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

func (*BeginRequest) Reset

func (x *BeginRequest) Reset()

func (*BeginRequest) String

func (x *BeginRequest) String() string

type BeginRequest_Contents

type BeginRequest_Contents struct {
	// The contents of the file.  This should generally be under
	// 1 MiB. If the contents exceed the server's configured maximum,
	// an error may be returned.
	Contents []byte `protobuf:"bytes,3,opt,name=contents,proto3,oneof"`
}

type BeginRequest_Empty

type BeginRequest_Empty struct {
	// If true, an empty file will be committed.
	Empty bool `protobuf:"varint,4,opt,name=empty,proto3,oneof"`
}

type BeginResponse

type BeginResponse struct {

	// Continuation data to provide to TransferRequest.
	State *TransferState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// The maximum number of bytes to include in a single transfer.
	MaxChunkSize int32 `protobuf:"varint,2,opt,name=max_chunk_size,json=maxChunkSize,proto3" json:"max_chunk_size,omitempty"`
	// If this field is true, the contents in the BeginRequest were
	// committed successfully and the transfer is finished.  If false,
	// the client can use the returned TransferState to perform the
	// file transfer as usual.
	Committed bool `protobuf:"varint,3,opt,name=committed,proto3" json:"committed,omitempty"`
	// contains filtered or unexported fields
}

func (*BeginResponse) Descriptor deprecated

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

Deprecated: Use BeginResponse.ProtoReflect.Descriptor instead.

func (*BeginResponse) GetCommitted

func (x *BeginResponse) GetCommitted() bool

func (*BeginResponse) GetMaxChunkSize

func (x *BeginResponse) GetMaxChunkSize() int32

func (*BeginResponse) GetState

func (x *BeginResponse) GetState() *TransferState

func (*BeginResponse) ProtoMessage

func (*BeginResponse) ProtoMessage()

func (*BeginResponse) ProtoReflect

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

func (*BeginResponse) Reset

func (x *BeginResponse) Reset()

func (*BeginResponse) String

func (x *BeginResponse) String() string

type CommitRequest

type CommitRequest struct {

	// Continuation data from a previous TransferRequest.
	State *TransferState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// Additional metadata to be returned when subsequently fetching the
	// file. The metadata is placed on the CommitRequest so that stream-
	// based operations (e.g. computing a checksum) may be performed
	// during the transfer process.
	Meta map[string]string `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CommitRequest) Descriptor deprecated

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

Deprecated: Use CommitRequest.ProtoReflect.Descriptor instead.

func (*CommitRequest) GetMeta

func (x *CommitRequest) GetMeta() map[string]string

func (*CommitRequest) GetState

func (x *CommitRequest) GetState() *TransferState

func (*CommitRequest) ProtoMessage

func (*CommitRequest) ProtoMessage()

func (*CommitRequest) ProtoReflect

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

func (*CommitRequest) Reset

func (x *CommitRequest) Reset()

func (*CommitRequest) String

func (x *CommitRequest) String() string

type CommitResponse

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

func (*CommitResponse) Descriptor deprecated

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

Deprecated: Use CommitResponse.ProtoReflect.Descriptor instead.

func (*CommitResponse) ProtoMessage

func (*CommitResponse) ProtoMessage()

func (*CommitResponse) ProtoReflect

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

func (*CommitResponse) Reset

func (x *CommitResponse) Reset()

func (*CommitResponse) String

func (x *CommitResponse) String() string

type FetchRequest

type FetchRequest struct {
	Tenant *tenant.ID `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	Path   string     `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// The URL to fetch.
	RemoteUrl string `protobuf:"bytes,3,opt,name=remote_url,json=remoteUrl,proto3" json:"remote_url,omitempty"`
	// Additional headers to append to the request, (e.g. Authorization).
	RemoteHeaders map[string]string `` /* 188-byte string literal not displayed */
	// The HTTP method to make the request with.
	// Defaults to GET if unspecified.
	RemoteMethod string `protobuf:"bytes,5,opt,name=remote_method,json=remoteMethod,proto3" json:"remote_method,omitempty"`
	// contains filtered or unexported fields
}

func (*FetchRequest) Descriptor deprecated

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

Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead.

func (*FetchRequest) GetPath

func (x *FetchRequest) GetPath() string

func (*FetchRequest) GetRemoteHeaders

func (x *FetchRequest) GetRemoteHeaders() map[string]string

func (*FetchRequest) GetRemoteMethod

func (x *FetchRequest) GetRemoteMethod() string

func (*FetchRequest) GetRemoteUrl

func (x *FetchRequest) GetRemoteUrl() string

func (*FetchRequest) GetTenant

func (x *FetchRequest) GetTenant() *tenant.ID

func (*FetchRequest) ProtoMessage

func (*FetchRequest) ProtoMessage()

func (*FetchRequest) ProtoReflect

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

func (*FetchRequest) Reset

func (x *FetchRequest) Reset()

func (*FetchRequest) String

func (x *FetchRequest) String() string

type FetchResponse

type FetchResponse struct {
	RemoteHttpCode    int32  `protobuf:"varint,1,opt,name=remote_http_code,json=remoteHttpCode,proto3" json:"remote_http_code,omitempty"`
	RemoteHttpMessage string `protobuf:"bytes,2,opt,name=remote_http_message,json=remoteHttpMessage,proto3" json:"remote_http_message,omitempty"`
	// contains filtered or unexported fields
}

func (*FetchResponse) Descriptor deprecated

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

Deprecated: Use FetchResponse.ProtoReflect.Descriptor instead.

func (*FetchResponse) GetRemoteHttpCode

func (x *FetchResponse) GetRemoteHttpCode() int32

func (*FetchResponse) GetRemoteHttpMessage

func (x *FetchResponse) GetRemoteHttpMessage() string

func (*FetchResponse) ProtoMessage

func (*FetchResponse) ProtoMessage()

func (*FetchResponse) ProtoReflect

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

func (*FetchResponse) Reset

func (x *FetchResponse) Reset()

func (*FetchResponse) String

func (x *FetchResponse) String() string

type ID

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

func NewID

func NewID() *ID

NewID constructs a new ID.

func (*ID) AsUUID

func (x *ID) AsUUID() uuid.UUID

AsUUID converts the message to a validated UUID or returns the zero value.

func (*ID) Descriptor deprecated

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

Deprecated: Use ID.ProtoReflect.Descriptor instead.

func (*ID) GetData

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

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) ProtoReflect

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

func (*ID) Reset

func (x *ID) Reset()

func (*ID) Scan

func (x *ID) Scan(v interface{}) error

Scan implements sql.Scanner.

func (*ID) String

func (x *ID) String() string

func (*ID) Value

func (x *ID) Value() (driver.Value, error)

Value implements driver.Valuer.

func (*ID) Zero

func (x *ID) Zero() bool

Zero returns true if the ID is the zero value.

type TransferRequest

type TransferRequest struct {

	// This state must be provided from either BeginResponse or a
	// previous TransferResponse.
	State *TransferState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// The size of data must not exceed BeginResponse.max_chunk_size.
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*TransferRequest) Descriptor deprecated

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

Deprecated: Use TransferRequest.ProtoReflect.Descriptor instead.

func (*TransferRequest) GetData

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

func (*TransferRequest) GetState

func (x *TransferRequest) GetState() *TransferState

func (*TransferRequest) ProtoMessage

func (*TransferRequest) ProtoMessage()

func (*TransferRequest) ProtoReflect

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

func (*TransferRequest) Reset

func (x *TransferRequest) Reset()

func (*TransferRequest) String

func (x *TransferRequest) String() string

type TransferResponse

type TransferResponse struct {

	// The state to pass into the next TransferRequest.
	State *TransferState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*TransferResponse) Descriptor deprecated

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

Deprecated: Use TransferResponse.ProtoReflect.Descriptor instead.

func (*TransferResponse) GetState

func (x *TransferResponse) GetState() *TransferState

func (*TransferResponse) ProtoMessage

func (*TransferResponse) ProtoMessage()

func (*TransferResponse) ProtoReflect

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

func (*TransferResponse) Reset

func (x *TransferResponse) Reset()

func (*TransferResponse) String

func (x *TransferResponse) String() string

type TransferState

type TransferState struct {
	ID        *ID                    `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Offset    int64                  `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	Data      []byte                 `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Deadline  *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=deadline,proto3" json:"deadline,omitempty"`
	TenantId  *tenant.ID             `protobuf:"bytes,5,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	Signature []byte                 `protobuf:"bytes,15,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

TransferState should be treated as an opaque value by the client. The structure of the message is not guaranteed by any API compatibility policy.

func (*TransferState) Descriptor deprecated

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

Deprecated: Use TransferState.ProtoReflect.Descriptor instead.

func (*TransferState) GetData

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

func (*TransferState) GetDeadline

func (x *TransferState) GetDeadline() *timestamppb.Timestamp

func (*TransferState) GetID

func (x *TransferState) GetID() *ID

func (*TransferState) GetOffset

func (x *TransferState) GetOffset() int64

func (*TransferState) GetSignature

func (x *TransferState) GetSignature() []byte

func (*TransferState) GetTenantId

func (x *TransferState) GetTenantId() *tenant.ID

func (*TransferState) ProtoMessage

func (*TransferState) ProtoMessage()

func (*TransferState) ProtoReflect

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

func (*TransferState) Reset

func (x *TransferState) Reset()

func (*TransferState) String

func (x *TransferState) String() string

type UnimplementedUploadsServer

type UnimplementedUploadsServer struct {
}

UnimplementedUploadsServer must be embedded to have forward compatible implementations.

func (UnimplementedUploadsServer) Begin

func (UnimplementedUploadsServer) Commit

func (UnimplementedUploadsServer) Fetch

func (UnimplementedUploadsServer) Transfer

type UnsafeUploadsServer

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

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

type UploadsClient

type UploadsClient interface {
	Begin(ctx context.Context, in *BeginRequest, opts ...grpc.CallOption) (*BeginResponse, error)
	Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error)
	Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchResponse, error)
	Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error)
}

UploadsClient is the client API for Uploads 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 NewUploadsClient

func NewUploadsClient(cc grpc.ClientConnInterface) UploadsClient

type UploadsServer

type UploadsServer interface {
	Begin(context.Context, *BeginRequest) (*BeginResponse, error)
	Commit(context.Context, *CommitRequest) (*CommitResponse, error)
	Fetch(context.Context, *FetchRequest) (*FetchResponse, error)
	Transfer(context.Context, *TransferRequest) (*TransferResponse, error)
	// contains filtered or unexported methods
}

UploadsServer is the server API for Uploads service. All implementations must embed UnimplementedUploadsServer for forward compatibility

Jump to

Keyboard shortcuts

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