mirror of
https://github.com/mautrix/signal.git
synced 2026-09-17 00:02:04 -04:00
167 lines
6.7 KiB
Go
Generated
167 lines
6.7 KiB
Go
Generated
//
|
|
// Copyright 2026 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc v7.34.1
|
|
// source: org/signal/chat/attachments.proto
|
|
|
|
package attachments
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
Attachments_GetUploadForm_FullMethodName = "/org.signal.chat.attachments.Attachments/GetUploadForm"
|
|
Attachments_GetStickerUploadForm_FullMethodName = "/org.signal.chat.attachments.Attachments/GetStickerUploadForm"
|
|
)
|
|
|
|
// AttachmentsClient is the client API for Attachments 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.
|
|
type AttachmentsClient interface {
|
|
// Retrieve an upload form that can be used to perform a resumable upload
|
|
GetUploadForm(ctx context.Context, in *GetUploadFormRequest, opts ...grpc.CallOption) (*GetUploadFormResponse, error)
|
|
// Retrieve an upload form that can be used to upload a sticker pack
|
|
GetStickerUploadForm(ctx context.Context, in *GetStickerUploadFormRequest, opts ...grpc.CallOption) (*GetStickerUploadFormResponse, error)
|
|
}
|
|
|
|
type attachmentsClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAttachmentsClient(cc grpc.ClientConnInterface) AttachmentsClient {
|
|
return &attachmentsClient{cc}
|
|
}
|
|
|
|
func (c *attachmentsClient) GetUploadForm(ctx context.Context, in *GetUploadFormRequest, opts ...grpc.CallOption) (*GetUploadFormResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetUploadFormResponse)
|
|
err := c.cc.Invoke(ctx, Attachments_GetUploadForm_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *attachmentsClient) GetStickerUploadForm(ctx context.Context, in *GetStickerUploadFormRequest, opts ...grpc.CallOption) (*GetStickerUploadFormResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetStickerUploadFormResponse)
|
|
err := c.cc.Invoke(ctx, Attachments_GetStickerUploadForm_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AttachmentsServer is the server API for Attachments service.
|
|
// All implementations must embed UnimplementedAttachmentsServer
|
|
// for forward compatibility.
|
|
type AttachmentsServer interface {
|
|
// Retrieve an upload form that can be used to perform a resumable upload
|
|
GetUploadForm(context.Context, *GetUploadFormRequest) (*GetUploadFormResponse, error)
|
|
// Retrieve an upload form that can be used to upload a sticker pack
|
|
GetStickerUploadForm(context.Context, *GetStickerUploadFormRequest) (*GetStickerUploadFormResponse, error)
|
|
mustEmbedUnimplementedAttachmentsServer()
|
|
}
|
|
|
|
// UnimplementedAttachmentsServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedAttachmentsServer struct{}
|
|
|
|
func (UnimplementedAttachmentsServer) GetUploadForm(context.Context, *GetUploadFormRequest) (*GetUploadFormResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetUploadForm not implemented")
|
|
}
|
|
func (UnimplementedAttachmentsServer) GetStickerUploadForm(context.Context, *GetStickerUploadFormRequest) (*GetStickerUploadFormResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetStickerUploadForm not implemented")
|
|
}
|
|
func (UnimplementedAttachmentsServer) mustEmbedUnimplementedAttachmentsServer() {}
|
|
func (UnimplementedAttachmentsServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAttachmentsServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AttachmentsServer will
|
|
// result in compilation errors.
|
|
type UnsafeAttachmentsServer interface {
|
|
mustEmbedUnimplementedAttachmentsServer()
|
|
}
|
|
|
|
func RegisterAttachmentsServer(s grpc.ServiceRegistrar, srv AttachmentsServer) {
|
|
// If the following call panics, it indicates UnimplementedAttachmentsServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&Attachments_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Attachments_GetUploadForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetUploadFormRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AttachmentsServer).GetUploadForm(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Attachments_GetUploadForm_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AttachmentsServer).GetUploadForm(ctx, req.(*GetUploadFormRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Attachments_GetStickerUploadForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetStickerUploadFormRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AttachmentsServer).GetStickerUploadForm(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Attachments_GetStickerUploadForm_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AttachmentsServer).GetStickerUploadForm(ctx, req.(*GetStickerUploadFormRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Attachments_ServiceDesc is the grpc.ServiceDesc for Attachments service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Attachments_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "org.signal.chat.attachments.Attachments",
|
|
HandlerType: (*AttachmentsServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetUploadForm",
|
|
Handler: _Attachments_GetUploadForm_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetStickerUploadForm",
|
|
Handler: _Attachments_GetStickerUploadForm_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "org/signal/chat/attachments.proto",
|
|
}
|