Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterSmsHTTPServer(s *http.Server, srv SmsHTTPServer)
- func RegisterSmsServer(s grpc.ServiceRegistrar, srv SmsServer)
- type AddSmsConfigRequest
- func (*AddSmsConfigRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddSmsConfigRequest) GetAccessKey() string
- func (x *AddSmsConfigRequest) GetAccessSecret() string
- func (x *AddSmsConfigRequest) GetSignName() string
- func (*AddSmsConfigRequest) ProtoMessage()
- func (x *AddSmsConfigRequest) ProtoReflect() protoreflect.Message
- func (x *AddSmsConfigRequest) Reset()
- func (x *AddSmsConfigRequest) String() string
- type Empty
- type Reply
- type SendSmsRequest
- func (*SendSmsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendSmsRequest) GetCode() string
- func (x *SendSmsRequest) GetPhone() string
- func (x *SendSmsRequest) GetSmsType() string
- func (x *SendSmsRequest) GetUuid() 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 ( Sms_AddSmsConfig_FullMethodName = "/api.sms.v1.Sms/AddSmsConfig" Sms_SendSms_FullMethodName = "/api.sms.v1.Sms/SendSms" )
const OperationSmsAddSmsConfig = "/api.sms.v1.Sms/AddSmsConfig"
const OperationSmsSendSms = "/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: "AddSmsConfig", Handler: _Sms_AddSmsConfig_Handler, }, { 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 AddSmsConfigRequest ¶ added in v0.0.15
type AddSmsConfigRequest struct { // 短信签名 SignName string `protobuf:"bytes,1,opt,name=sign_name,json=signName,proto3" json:"sign_name,omitempty"` // 短信KEY AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` // 短信密钥 AccessSecret string `protobuf:"bytes,3,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"` // contains filtered or unexported fields }
增加短信配置
func (*AddSmsConfigRequest) Descriptor
deprecated
added in
v0.0.15
func (*AddSmsConfigRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddSmsConfigRequest.ProtoReflect.Descriptor instead.
func (*AddSmsConfigRequest) GetAccessKey ¶ added in v0.0.15
func (x *AddSmsConfigRequest) GetAccessKey() string
func (*AddSmsConfigRequest) GetAccessSecret ¶ added in v0.0.15
func (x *AddSmsConfigRequest) GetAccessSecret() string
func (*AddSmsConfigRequest) GetSignName ¶ added in v0.0.15
func (x *AddSmsConfigRequest) GetSignName() string
func (*AddSmsConfigRequest) ProtoMessage ¶ added in v0.0.15
func (*AddSmsConfigRequest) ProtoMessage()
func (*AddSmsConfigRequest) ProtoReflect ¶ added in v0.0.15
func (x *AddSmsConfigRequest) ProtoReflect() protoreflect.Message
func (*AddSmsConfigRequest) Reset ¶ added in v0.0.15
func (x *AddSmsConfigRequest) Reset()
func (*AddSmsConfigRequest) String ¶ added in v0.0.15
func (x *AddSmsConfigRequest) String() string
type Empty ¶ added in v0.0.20
type Empty struct {
// contains filtered or unexported fields
}
空消息
func (*Empty) Descriptor
deprecated
added in
v0.0.20
func (*Empty) ProtoMessage ¶ added in v0.0.20
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶ added in v0.0.20
func (x *Empty) ProtoReflect() protoreflect.Message
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"` // 验证码结果 Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` // 验证码字段 Uuid string `protobuf:"bytes,4,opt,name=uuid,proto3" json:"uuid,omitempty"` // contains filtered or unexported fields }
发送短信参数
func (*SendSmsRequest) Descriptor
deprecated
func (*SendSmsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendSmsRequest.ProtoReflect.Descriptor instead.
func (*SendSmsRequest) GetCode ¶ added in v0.0.14
func (x *SendSmsRequest) GetCode() string
func (*SendSmsRequest) GetPhone ¶
func (x *SendSmsRequest) GetPhone() string
func (*SendSmsRequest) GetSmsType ¶
func (x *SendSmsRequest) GetSmsType() string
func (*SendSmsRequest) GetUuid ¶ added in v0.0.14
func (x *SendSmsRequest) GetUuid() 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 { // 增加短信配置 AddSmsConfig(ctx context.Context, in *AddSmsConfigRequest, opts ...grpc.CallOption) (*Reply, error) // 发送短信 SendSms(ctx context.Context, in *SendSmsRequest, opts ...grpc.CallOption) (*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 { AddSmsConfig(ctx context.Context, req *AddSmsConfigRequest, opts ...http.CallOption) (rsp *Reply, err error) SendSms(ctx context.Context, req *SendSmsRequest, opts ...http.CallOption) (rsp *Reply, err error) }
func NewSmsHTTPClient ¶
func NewSmsHTTPClient(client *http.Client) SmsHTTPClient
type SmsHTTPClientImpl ¶
type SmsHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*SmsHTTPClientImpl) AddSmsConfig ¶ added in v0.0.15
func (c *SmsHTTPClientImpl) AddSmsConfig(ctx context.Context, in *AddSmsConfigRequest, opts ...http.CallOption) (*Reply, error)
func (*SmsHTTPClientImpl) SendSms ¶
func (c *SmsHTTPClientImpl) SendSms(ctx context.Context, in *SendSmsRequest, opts ...http.CallOption) (*Reply, error)
type SmsHTTPServer ¶
type SmsHTTPServer interface { // AddSmsConfig 增加短信配置 AddSmsConfig(context.Context, *AddSmsConfigRequest) (*Reply, error) // SendSms 发送短信 SendSms(context.Context, *SendSmsRequest) (*Reply, error) }
type SmsServer ¶
type SmsServer interface { // 增加短信配置 AddSmsConfig(context.Context, *AddSmsConfigRequest) (*Reply, error) // 发送短信 SendSms(context.Context, *SendSmsRequest) (*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) AddSmsConfig ¶ added in v0.0.15
func (UnimplementedSmsServer) AddSmsConfig(context.Context, *AddSmsConfigRequest) (*Reply, error)
func (UnimplementedSmsServer) SendSms ¶
func (UnimplementedSmsServer) SendSms(context.Context, *SendSmsRequest) (*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.