v1

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const OperationSmsSendSms = "/api.sms.v1.Sms/SendSms"
View Source
const (
	Sms_SendSms_FullMethodName = "/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: "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) 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"`
	// 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 SmsHTTPServer interface {
	// SendSms 发送短信
	SendSms(context.Context, *SendSmsRequest) (*v1.Reply, error)
}

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

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