Documentation ¶
Overview ¶
Package sms is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSMSAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSMSAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SMSAPIClient) error
- func RegisterSMSAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSMSAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SMSAPIServer) error
- func RegisterSMSAPIServer(s grpc.ServiceRegistrar, srv SMSAPIServer)
- type SMS
- type SMSAPIClient
- type SMSAPIServer
- type SendSMSRequest
- func (*SendSMSRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendSMSRequest) GetAuth() *SendSMSRequest_SMSAuth
- func (x *SendSMSRequest) GetProvider() SmsProvider
- func (x *SendSMSRequest) GetSms() *SMS
- func (*SendSMSRequest) ProtoMessage()
- func (x *SendSMSRequest) ProtoReflect() protoreflect.Message
- func (x *SendSMSRequest) Reset()
- func (x *SendSMSRequest) String() string
- type SendSMSRequest_Cookie
- func (*SendSMSRequest_Cookie) Descriptor() ([]byte, []int)deprecated
- func (x *SendSMSRequest_Cookie) GetName() string
- func (x *SendSMSRequest_Cookie) GetValue() string
- func (*SendSMSRequest_Cookie) ProtoMessage()
- func (x *SendSMSRequest_Cookie) ProtoReflect() protoreflect.Message
- func (x *SendSMSRequest_Cookie) Reset()
- func (x *SendSMSRequest_Cookie) String() string
- type SendSMSRequest_SMSAuth
- func (*SendSMSRequest_SMSAuth) Descriptor() ([]byte, []int)deprecated
- func (x *SendSMSRequest_SMSAuth) GetAccessKey() string
- func (x *SendSMSRequest_SMSAuth) GetApiKey() string
- func (x *SendSMSRequest_SMSAuth) GetApiUrl() string
- func (x *SendSMSRequest_SMSAuth) GetAppName() string
- func (x *SendSMSRequest_SMSAuth) GetAuthToken() string
- func (x *SendSMSRequest_SMSAuth) GetClientId() string
- func (x *SendSMSRequest_SMSAuth) GetCookies() []*SendSMSRequest_Cookie
- func (x *SendSMSRequest_SMSAuth) GetSenderId() string
- func (*SendSMSRequest_SMSAuth) ProtoMessage()
- func (x *SendSMSRequest_SMSAuth) ProtoReflect() protoreflect.Message
- func (x *SendSMSRequest_SMSAuth) Reset()
- func (x *SendSMSRequest_SMSAuth) String() string
- type SmsProvider
- func (SmsProvider) Descriptor() protoreflect.EnumDescriptor
- func (x SmsProvider) Enum() *SmsProvider
- func (SmsProvider) EnumDescriptor() ([]byte, []int)deprecated
- func (x SmsProvider) Number() protoreflect.EnumNumber
- func (x SmsProvider) String() string
- func (SmsProvider) Type() protoreflect.EnumType
- type UnimplementedSMSAPIServer
- type UnsafeSMSAPIServer
Constants ¶
This section is empty.
Variables ¶
var ( SmsProvider_name = map[int32]string{ 0: "ONFON", } SmsProvider_value = map[string]int32{ "ONFON": 0, } )
Enum value maps for SmsProvider.
var File_sms_proto protoreflect.FileDescriptor
Functions ¶
func RegisterSMSAPIHandler ¶
RegisterSMSAPIHandler registers the http handlers for service SMSAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSMSAPIHandlerClient ¶
func RegisterSMSAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SMSAPIClient) error
RegisterSMSAPIHandlerClient registers the http handlers for service SMSAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SMSAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SMSAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SMSAPIClient" to call the correct interceptors.
func RegisterSMSAPIHandlerFromEndpoint ¶
func RegisterSMSAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSMSAPIHandlerFromEndpoint is same as RegisterSMSAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSMSAPIHandlerServer ¶
func RegisterSMSAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SMSAPIServer) error
RegisterSMSAPIHandlerServer registers the http handlers for service SMSAPI to "mux". UnaryRPC :call SMSAPIServer 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 RegisterSMSAPIHandlerFromEndpoint instead.
func RegisterSMSAPIServer ¶
func RegisterSMSAPIServer(s grpc.ServiceRegistrar, srv SMSAPIServer)
Types ¶
type SMS ¶
type SMS struct { DestinationPhones []string `protobuf:"bytes,2,rep,name=destination_phones,json=destinationPhones,proto3" json:"destination_phones,omitempty"` Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SMS) Descriptor
deprecated
func (*SMS) GetDestinationPhones ¶
func (*SMS) GetKeyword ¶
func (*SMS) GetMessage ¶
func (*SMS) ProtoMessage ¶
func (*SMS) ProtoMessage()
func (*SMS) ProtoReflect ¶
func (x *SMS) ProtoReflect() protoreflect.Message
type SMSAPIClient ¶
type SMSAPIClient interface { // Send an sms to its destination(s) SendSMS(ctx context.Context, in *SendSMSRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
SMSAPIClient is the client API for SMSAPI 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 NewSMSAPIClient ¶
func NewSMSAPIClient(cc grpc.ClientConnInterface) SMSAPIClient
type SMSAPIServer ¶
type SMSAPIServer interface { // Send an sms to its destination(s) SendSMS(context.Context, *SendSMSRequest) (*empty.Empty, error) // contains filtered or unexported methods }
SMSAPIServer is the server API for SMSAPI service. All implementations must embed UnimplementedSMSAPIServer for forward compatibility
type SendSMSRequest ¶
type SendSMSRequest struct { Sms *SMS `protobuf:"bytes,1,opt,name=sms,proto3" json:"sms,omitempty"` Auth *SendSMSRequest_SMSAuth `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth,omitempty"` Provider SmsProvider `protobuf:"varint,3,opt,name=provider,proto3,enum=gidyon.apis.SmsProvider" json:"provider,omitempty"` // contains filtered or unexported fields }
func (*SendSMSRequest) Descriptor
deprecated
func (*SendSMSRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendSMSRequest.ProtoReflect.Descriptor instead.
func (*SendSMSRequest) GetAuth ¶
func (x *SendSMSRequest) GetAuth() *SendSMSRequest_SMSAuth
func (*SendSMSRequest) GetProvider ¶
func (x *SendSMSRequest) GetProvider() SmsProvider
func (*SendSMSRequest) GetSms ¶
func (x *SendSMSRequest) GetSms() *SMS
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 SendSMSRequest_Cookie ¶ added in v0.9.2
type SendSMSRequest_Cookie struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*SendSMSRequest_Cookie) Descriptor
deprecated
added in
v0.9.2
func (*SendSMSRequest_Cookie) Descriptor() ([]byte, []int)
Deprecated: Use SendSMSRequest_Cookie.ProtoReflect.Descriptor instead.
func (*SendSMSRequest_Cookie) GetName ¶ added in v0.9.2
func (x *SendSMSRequest_Cookie) GetName() string
func (*SendSMSRequest_Cookie) GetValue ¶ added in v0.9.2
func (x *SendSMSRequest_Cookie) GetValue() string
func (*SendSMSRequest_Cookie) ProtoMessage ¶ added in v0.9.2
func (*SendSMSRequest_Cookie) ProtoMessage()
func (*SendSMSRequest_Cookie) ProtoReflect ¶ added in v0.9.2
func (x *SendSMSRequest_Cookie) ProtoReflect() protoreflect.Message
func (*SendSMSRequest_Cookie) Reset ¶ added in v0.9.2
func (x *SendSMSRequest_Cookie) Reset()
func (*SendSMSRequest_Cookie) String ¶ added in v0.9.2
func (x *SendSMSRequest_Cookie) String() string
type SendSMSRequest_SMSAuth ¶ added in v0.9.2
type SendSMSRequest_SMSAuth struct { // [sms_url, sender_id, api_key, client_id, auth_token, access_key, cookies] ApiUrl string `protobuf:"bytes,1,opt,name=api_url,json=apiUrl,proto3" json:"api_url,omitempty"` SenderId string `protobuf:"bytes,2,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` ApiKey string `protobuf:"bytes,3,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` AuthToken string `protobuf:"bytes,5,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"` AccessKey string `protobuf:"bytes,6,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` Cookies []*SendSMSRequest_Cookie `protobuf:"bytes,7,rep,name=cookies,proto3" json:"cookies,omitempty"` AppName string `protobuf:"bytes,8,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` // contains filtered or unexported fields }
func (*SendSMSRequest_SMSAuth) Descriptor
deprecated
added in
v0.9.2
func (*SendSMSRequest_SMSAuth) Descriptor() ([]byte, []int)
Deprecated: Use SendSMSRequest_SMSAuth.ProtoReflect.Descriptor instead.
func (*SendSMSRequest_SMSAuth) GetAccessKey ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) GetAccessKey() string
func (*SendSMSRequest_SMSAuth) GetApiKey ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) GetApiKey() string
func (*SendSMSRequest_SMSAuth) GetApiUrl ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) GetApiUrl() string
func (*SendSMSRequest_SMSAuth) GetAppName ¶ added in v0.11.3
func (x *SendSMSRequest_SMSAuth) GetAppName() string
func (*SendSMSRequest_SMSAuth) GetAuthToken ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) GetAuthToken() string
func (*SendSMSRequest_SMSAuth) GetClientId ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) GetClientId() string
func (*SendSMSRequest_SMSAuth) GetCookies ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) GetCookies() []*SendSMSRequest_Cookie
func (*SendSMSRequest_SMSAuth) GetSenderId ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) GetSenderId() string
func (*SendSMSRequest_SMSAuth) ProtoMessage ¶ added in v0.9.2
func (*SendSMSRequest_SMSAuth) ProtoMessage()
func (*SendSMSRequest_SMSAuth) ProtoReflect ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) ProtoReflect() protoreflect.Message
func (*SendSMSRequest_SMSAuth) Reset ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) Reset()
func (*SendSMSRequest_SMSAuth) String ¶ added in v0.9.2
func (x *SendSMSRequest_SMSAuth) String() string
type SmsProvider ¶
type SmsProvider int32
const (
SmsProvider_ONFON SmsProvider = 0
)
func (SmsProvider) Descriptor ¶
func (SmsProvider) Descriptor() protoreflect.EnumDescriptor
func (SmsProvider) Enum ¶
func (x SmsProvider) Enum() *SmsProvider
func (SmsProvider) EnumDescriptor
deprecated
func (SmsProvider) EnumDescriptor() ([]byte, []int)
Deprecated: Use SmsProvider.Descriptor instead.
func (SmsProvider) Number ¶
func (x SmsProvider) Number() protoreflect.EnumNumber
func (SmsProvider) String ¶
func (x SmsProvider) String() string
func (SmsProvider) Type ¶
func (SmsProvider) Type() protoreflect.EnumType
type UnimplementedSMSAPIServer ¶
type UnimplementedSMSAPIServer struct { }
UnimplementedSMSAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedSMSAPIServer) SendSMS ¶
func (UnimplementedSMSAPIServer) SendSMS(context.Context, *SendSMSRequest) (*empty.Empty, error)
type UnsafeSMSAPIServer ¶
type UnsafeSMSAPIServer interface {
// contains filtered or unexported methods
}
UnsafeSMSAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SMSAPIServer will result in compilation errors.