Documentation ¶
Index ¶
- Variables
- func RegisterHookServiceServer(s grpc.ServiceRegistrar, srv HookServiceServer)
- type HTTPRequest
- func (*HTTPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HTTPRequest) GetBearerAuth() string
- func (x *HTTPRequest) GetMethod() string
- func (x *HTTPRequest) GetRemoteAddr() string
- func (x *HTTPRequest) GetUri() string
- func (*HTTPRequest) ProtoMessage()
- func (x *HTTPRequest) ProtoReflect() protoreflect.Message
- func (x *HTTPRequest) Reset()
- func (x *HTTPRequest) String() string
- type Hook
- type HookServiceClient
- type HookServiceServer
- type SendRequest
- type SendResponse
- type UnimplementedHookServiceServer
- type UnsafeHookServiceServer
- type Upload
- func (*Upload) Descriptor() ([]byte, []int)deprecated
- func (x *Upload) GetId() string
- func (x *Upload) GetIsFinal() bool
- func (x *Upload) GetIsPartial() bool
- func (x *Upload) GetMetaData() map[string]string
- func (x *Upload) GetOffset() int64
- func (x *Upload) GetPartialUploads() []string
- func (x *Upload) GetSize() int64
- func (x *Upload) GetSizeIsDeferred() bool
- func (x *Upload) GetStorage() map[string]string
- func (*Upload) ProtoMessage()
- func (x *Upload) ProtoReflect() protoreflect.Message
- func (x *Upload) Reset()
- func (x *Upload) String() string
Constants ¶
This section is empty.
Variables ¶
var File_cmd_tusd_cli_hooks_proto_v2_hook_proto protoreflect.FileDescriptor
var HookService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "v2.HookService", HandlerType: (*HookServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Send", Handler: _HookService_Send_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cmd/tusd/cli/hooks/proto/v2/hook.proto", }
HookService_ServiceDesc is the grpc.ServiceDesc for HookService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHookServiceServer ¶
func RegisterHookServiceServer(s grpc.ServiceRegistrar, srv HookServiceServer)
Types ¶
type HTTPRequest ¶
type HTTPRequest struct { // Method is the HTTP method, e.g. POST or PATCH Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // URI is the full HTTP request URI, e.g. /files/fooo Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` // RemoteAddr contains the network address that sent the request RemoteAddr string `protobuf:"bytes,3,opt,name=remoteAddr,proto3" json:"remoteAddr,omitempty"` // BearerAuth contains the HTTP Authorization header value BearerAuth string `protobuf:"bytes,4,opt,name=bearerAuth,proto3" json:"bearerAuth,omitempty"` // contains filtered or unexported fields }
func (*HTTPRequest) Descriptor
deprecated
func (*HTTPRequest) Descriptor() ([]byte, []int)
Deprecated: Use HTTPRequest.ProtoReflect.Descriptor instead.
func (*HTTPRequest) GetBearerAuth ¶
func (x *HTTPRequest) GetBearerAuth() string
func (*HTTPRequest) GetMethod ¶
func (x *HTTPRequest) GetMethod() string
func (*HTTPRequest) GetRemoteAddr ¶
func (x *HTTPRequest) GetRemoteAddr() string
func (*HTTPRequest) GetUri ¶
func (x *HTTPRequest) GetUri() string
func (*HTTPRequest) ProtoMessage ¶
func (*HTTPRequest) ProtoMessage()
func (*HTTPRequest) ProtoReflect ¶
func (x *HTTPRequest) ProtoReflect() protoreflect.Message
func (*HTTPRequest) Reset ¶
func (x *HTTPRequest) Reset()
func (*HTTPRequest) String ¶
func (x *HTTPRequest) String() string
type Hook ¶
type Hook struct { // Upload contains information about the upload that caused this hook // to be fired. Upload *Upload `protobuf:"bytes,1,opt,name=upload,proto3" json:"upload,omitempty"` // HTTPRequest contains details about the HTTP request that reached // tusd. HttpRequest *HTTPRequest `protobuf:"bytes,2,opt,name=httpRequest,proto3" json:"httpRequest,omitempty"` // The hook name Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
Hook's data
func (*Hook) Descriptor
deprecated
func (*Hook) GetHttpRequest ¶
func (x *Hook) GetHttpRequest() *HTTPRequest
func (*Hook) ProtoMessage ¶
func (*Hook) ProtoMessage()
func (*Hook) ProtoReflect ¶
func (x *Hook) ProtoReflect() protoreflect.Message
type HookServiceClient ¶
type HookServiceClient interface { // Sends a hook Send(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error) }
HookServiceClient is the client API for HookService 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 NewHookServiceClient ¶
func NewHookServiceClient(cc grpc.ClientConnInterface) HookServiceClient
type HookServiceServer ¶
type HookServiceServer interface { // Sends a hook Send(context.Context, *SendRequest) (*SendResponse, error) // contains filtered or unexported methods }
HookServiceServer is the server API for HookService service. All implementations must embed UnimplementedHookServiceServer for forward compatibility
type SendRequest ¶
type SendRequest struct { // The hook data Hook *Hook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"` // contains filtered or unexported fields }
Request data to send hook
func (*SendRequest) Descriptor
deprecated
func (*SendRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendRequest.ProtoReflect.Descriptor instead.
func (*SendRequest) GetHook ¶
func (x *SendRequest) GetHook() *Hook
func (*SendRequest) ProtoMessage ¶
func (*SendRequest) ProtoMessage()
func (*SendRequest) ProtoReflect ¶
func (x *SendRequest) ProtoReflect() protoreflect.Message
func (*SendRequest) Reset ¶
func (x *SendRequest) Reset()
func (*SendRequest) String ¶
func (x *SendRequest) String() string
type SendResponse ¶
type SendResponse struct { // The response of the hook. Response *any1.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` // contains filtered or unexported fields }
Response that contains data for sended hook
func (*SendResponse) Descriptor
deprecated
func (*SendResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendResponse.ProtoReflect.Descriptor instead.
func (*SendResponse) GetResponse ¶
func (x *SendResponse) GetResponse() *any1.Any
func (*SendResponse) ProtoMessage ¶
func (*SendResponse) ProtoMessage()
func (*SendResponse) ProtoReflect ¶
func (x *SendResponse) ProtoReflect() protoreflect.Message
func (*SendResponse) Reset ¶
func (x *SendResponse) Reset()
func (*SendResponse) String ¶
func (x *SendResponse) String() string
type UnimplementedHookServiceServer ¶
type UnimplementedHookServiceServer struct { }
UnimplementedHookServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedHookServiceServer) Send ¶
func (UnimplementedHookServiceServer) Send(context.Context, *SendRequest) (*SendResponse, error)
type UnsafeHookServiceServer ¶
type UnsafeHookServiceServer interface {
// contains filtered or unexported methods
}
UnsafeHookServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HookServiceServer will result in compilation errors.
type Upload ¶
type Upload struct { // Unique integer identifier of the uploaded file Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Total file size in bytes specified in the NewUpload call Size int64 `protobuf:"varint,2,opt,name=Size,proto3" json:"Size,omitempty"` // Indicates whether the total file size is deferred until later SizeIsDeferred bool `protobuf:"varint,3,opt,name=SizeIsDeferred,proto3" json:"SizeIsDeferred,omitempty"` // Offset in bytes (zero-based) Offset int64 `protobuf:"varint,4,opt,name=Offset,proto3" json:"Offset,omitempty"` MetaData map[string]string `` /* 157-byte string literal not displayed */ // Indicates that this is a partial upload which will later be used to form // a final upload by concatenation. Partial uploads should not be processed // when they are finished since they are only incomplete chunks of files. IsPartial bool `protobuf:"varint,6,opt,name=isPartial,proto3" json:"isPartial,omitempty"` // Indicates that this is a final upload IsFinal bool `protobuf:"varint,7,opt,name=isFinal,proto3" json:"isFinal,omitempty"` // If the upload is a final one (see IsFinal) this will be a non-empty // ordered slice containing the ids of the uploads of which the final upload // will consist after concatenation. PartialUploads []string `protobuf:"bytes,8,rep,name=partialUploads,proto3" json:"partialUploads,omitempty"` // Storage contains information about where the data storage saves the upload, // for example a file path. The available values vary depending on what data // store is used. This map may also be nil. Storage map[string]string `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
Uploaded data
func (*Upload) Descriptor
deprecated
func (*Upload) GetIsFinal ¶
func (*Upload) GetIsPartial ¶
func (*Upload) GetMetaData ¶
func (*Upload) GetPartialUploads ¶
func (*Upload) GetSizeIsDeferred ¶
func (*Upload) GetStorage ¶
func (*Upload) ProtoMessage ¶
func (*Upload) ProtoMessage()
func (*Upload) ProtoReflect ¶
func (x *Upload) ProtoReflect() protoreflect.Message