v1

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sms_AddSmsConfig_FullMethodName = "/api.sms.v1.Sms/AddSmsConfig"
	Sms_SendSms_FullMethodName      = "/api.sms.v1.Sms/SendSms"
)
View Source
const OperationSmsAddSmsConfig = "/api.sms.v1.Sms/AddSmsConfig"
View Source
const OperationSmsSendSms = "/api.sms.v1.Sms/SendSms"

Variables

View Source
var File_sms_v1_common_proto protoreflect.FileDescriptor
View Source
var File_sms_v1_sms_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

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

func (*Empty) Reset added in v0.0.20

func (x *Empty) Reset()

func (*Empty) String added in v0.0.20

func (x *Empty) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Reply.ProtoReflect.Descriptor instead.

func (*Reply) GetData

func (x *Reply) GetData() string

func (*Reply) GetMessage

func (x *Reply) GetMessage() string

func (*Reply) GetStatusCode

func (x *Reply) GetStatusCode() int32

func (*Reply) ProtoMessage

func (*Reply) ProtoMessage()

func (*Reply) ProtoReflect

func (x *Reply) ProtoReflect() protoreflect.Message

func (*Reply) Reset

func (x *Reply) Reset()

func (*Reply) String

func (x *Reply) String() string

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) SendSms

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.

Jump to

Keyboard shortcuts

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