Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterSmsHTTPServer(s *http.Server, srv SmsHTTPServer)
- func RegisterSmsServer(s grpc.ServiceRegistrar, srv SmsServer)
- type Reply
- type SendSmsRequest
- func (*SendSmsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendSmsRequest) GetPhone() string
- func (x *SendSmsRequest) GetSmsType() string
- func (*SendSmsRequest) ProtoMessage()
- func (x *SendSmsRequest) ProtoReflect() protoreflect.Message
- func (x *SendSmsRequest) Reset()
- func (x *SendSmsRequest) String() string
- type SmsClient
- type SmsHTTPClient
- type SmsHTTPClientImpl
- type SmsHTTPServer
- type SmsServer
- type UnimplementedSmsServer
- type UnsafeSmsServer
Constants ¶
const OperationSmsSendSms = "/api.sms.v1.Sms/SendSms"
const (
Sms_SendSms_FullMethodName = "/api.sms.v1.Sms/SendSms"
)
Variables ¶
var File_sms_v1_common_proto protoreflect.FileDescriptor
var File_sms_v1_sms_proto protoreflect.FileDescriptor
var Sms_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.sms.v1.Sms", HandlerType: (*SmsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendSms", Handler: _Sms_SendSms_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "sms/v1/sms.proto", }
Sms_ServiceDesc is the grpc.ServiceDesc for Sms service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSmsHTTPServer ¶
func RegisterSmsHTTPServer(s *http.Server, srv SmsHTTPServer)
func RegisterSmsServer ¶
func RegisterSmsServer(s grpc.ServiceRegistrar, srv SmsServer)
Types ¶
type Reply ¶
type Reply struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` // 状态码 Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 提示信息 Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // json字符串 // contains filtered or unexported fields }
func (*Reply) Descriptor
deprecated
func (*Reply) GetMessage ¶
func (*Reply) GetStatusCode ¶
func (*Reply) ProtoMessage ¶
func (*Reply) ProtoMessage()
func (*Reply) ProtoReflect ¶
func (x *Reply) ProtoReflect() protoreflect.Message
type SendSmsRequest ¶
type SendSmsRequest struct { // 手机号 Phone string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"` // 发送类型 SmsType string `protobuf:"bytes,2,opt,name=sms_type,json=smsType,proto3" json:"sms_type,omitempty"` // contains filtered or unexported fields }
发送短信参数
func (*SendSmsRequest) Descriptor
deprecated
func (*SendSmsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendSmsRequest.ProtoReflect.Descriptor instead.
func (*SendSmsRequest) GetPhone ¶
func (x *SendSmsRequest) GetPhone() string
func (*SendSmsRequest) GetSmsType ¶
func (x *SendSmsRequest) GetSmsType() string
func (*SendSmsRequest) ProtoMessage ¶
func (*SendSmsRequest) ProtoMessage()
func (*SendSmsRequest) ProtoReflect ¶
func (x *SendSmsRequest) ProtoReflect() protoreflect.Message
func (*SendSmsRequest) Reset ¶
func (x *SendSmsRequest) Reset()
func (*SendSmsRequest) String ¶
func (x *SendSmsRequest) String() string
type SmsClient ¶
type SmsClient interface { // 发送短信 SendSms(ctx context.Context, in *SendSmsRequest, opts ...grpc.CallOption) (*v1.Reply, error) }
SmsClient is the client API for Sms 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 NewSmsClient ¶
func NewSmsClient(cc grpc.ClientConnInterface) SmsClient
type SmsHTTPClient ¶
type SmsHTTPClient interface {
SendSms(ctx context.Context, req *SendSmsRequest, opts ...http.CallOption) (rsp *v1.Reply, err error)
}
func NewSmsHTTPClient ¶
func NewSmsHTTPClient(client *http.Client) SmsHTTPClient
type SmsHTTPClientImpl ¶
type SmsHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*SmsHTTPClientImpl) SendSms ¶
func (c *SmsHTTPClientImpl) SendSms(ctx context.Context, in *SendSmsRequest, opts ...http.CallOption) (*v1.Reply, error)
type SmsHTTPServer ¶
type SmsServer ¶
type SmsServer interface { // 发送短信 SendSms(context.Context, *SendSmsRequest) (*v1.Reply, error) // contains filtered or unexported methods }
SmsServer is the server API for Sms service. All implementations must embed UnimplementedSmsServer for forward compatibility.
type UnimplementedSmsServer ¶
type UnimplementedSmsServer struct{}
UnimplementedSmsServer 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.
func (UnimplementedSmsServer) SendSms ¶
func (UnimplementedSmsServer) SendSms(context.Context, *SendSmsRequest) (*v1.Reply, error)
type UnsafeSmsServer ¶
type UnsafeSmsServer interface {
// contains filtered or unexported methods
}
UnsafeSmsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SmsServer will result in compilation errors.