smsv1

package
v0.0.0-...-c662a9e Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package smsv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_sms_v1_sms_proto protoreflect.FileDescriptor
View Source
var SmsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sms.v1.SmsService",
	HandlerType: (*SmsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Send",
			Handler:    _SmsService_Send_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "sms/v1/sms.proto",
}

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

Functions

func RegisterSmsServiceHandler

func RegisterSmsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSmsServiceHandler registers the http handlers for service SmsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSmsServiceHandlerClient

func RegisterSmsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SmsServiceClient) error

RegisterSmsServiceHandlerClient registers the http handlers for service SmsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SmsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SmsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SmsServiceClient" to call the correct interceptors.

func RegisterSmsServiceHandlerFromEndpoint

func RegisterSmsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSmsServiceHandlerFromEndpoint is same as RegisterSmsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSmsServiceHandlerServer

func RegisterSmsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SmsServiceServer) error

RegisterSmsServiceHandlerServer registers the http handlers for service SmsService to "mux". UnaryRPC :call SmsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSmsServiceHandlerFromEndpoint instead.

func RegisterSmsServiceServer

func RegisterSmsServiceServer(s grpc.ServiceRegistrar, srv SmsServiceServer)

Types

type SendRequest

type SendRequest struct {

	// target phone number
	// format: E.167
	To      string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*SendRequest) Descriptor deprecated

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

Deprecated: Use SendRequest.ProtoReflect.Descriptor instead.

func (*SendRequest) GetMessage

func (x *SendRequest) GetMessage() string

func (*SendRequest) GetTo

func (x *SendRequest) GetTo() string

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 {
	// contains filtered or unexported fields
}

func (*SendResponse) Descriptor deprecated

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

Deprecated: Use SendResponse.ProtoReflect.Descriptor instead.

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 SmsServiceClient

type SmsServiceClient interface {
	Send(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error)
}

SmsServiceClient is the client API for SmsService service.

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

func NewSmsServiceClient

func NewSmsServiceClient(cc grpc.ClientConnInterface) SmsServiceClient

type SmsServiceServer

type SmsServiceServer interface {
	Send(context.Context, *SendRequest) (*SendResponse, error)
}

SmsServiceServer is the server API for SmsService service. All implementations should embed UnimplementedSmsServiceServer for forward compatibility

type UnimplementedSmsServiceServer

type UnimplementedSmsServiceServer struct {
}

UnimplementedSmsServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedSmsServiceServer) Send

type UnsafeSmsServiceServer

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

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

Jump to

Keyboard shortcuts

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