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 Cookie
- type CreateSenderCredentialsRequest
- func (*CreateSenderCredentialsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateSenderCredentialsRequest) GetCredential() *SenderCredential
- func (*CreateSenderCredentialsRequest) ProtoMessage()
- func (x *CreateSenderCredentialsRequest) ProtoReflect() protoreflect.Message
- func (x *CreateSenderCredentialsRequest) Reset()
- func (x *CreateSenderCredentialsRequest) String() string
- type GetSenderCredentialRequest
- func (*GetSenderCredentialRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSenderCredentialRequest) GetCredentialId() string
- func (x *GetSenderCredentialRequest) GetUseProjectId() bool
- func (*GetSenderCredentialRequest) ProtoMessage()
- func (x *GetSenderCredentialRequest) ProtoReflect() protoreflect.Message
- func (x *GetSenderCredentialRequest) Reset()
- func (x *GetSenderCredentialRequest) String() string
- type SMS
- type SMSAPIClient
- type SMSAPIServer
- type SMSAuth
- func (*SMSAuth) Descriptor() ([]byte, []int)deprecated
- func (x *SMSAuth) GetAccessKey() string
- func (x *SMSAuth) GetApiKey() string
- func (x *SMSAuth) GetApiUrl() string
- func (x *SMSAuth) GetAppName() string
- func (x *SMSAuth) GetAuthToken() string
- func (x *SMSAuth) GetClientId() string
- func (x *SMSAuth) GetCookies() []*Cookie
- func (x *SMSAuth) GetSenderId() string
- func (*SMSAuth) ProtoMessage()
- func (x *SMSAuth) ProtoReflect() protoreflect.Message
- func (x *SMSAuth) Reset()
- func (x *SMSAuth) String() string
- type SendSMSRequest
- func (*SendSMSRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendSMSRequest) GetAuth() *SMSAuth
- func (x *SendSMSRequest) GetFetchSender() bool
- func (x *SendSMSRequest) GetProjectId() string
- 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 SenderCredential
- func (*SenderCredential) Descriptor() ([]byte, []int)deprecated
- func (x *SenderCredential) GetAuth() *SMSAuth
- func (x *SenderCredential) GetCredentialId() string
- func (x *SenderCredential) GetProjectId() string
- func (*SenderCredential) ProtoMessage()
- func (x *SenderCredential) ProtoReflect() protoreflect.Message
- func (x *SenderCredential) Reset()
- func (x *SenderCredential) 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
- func (UnimplementedSMSAPIServer) CreateSenderCredential(context.Context, *CreateSenderCredentialsRequest) (*empty.Empty, error)
- func (UnimplementedSMSAPIServer) GetSenderCredential(context.Context, *GetSenderCredentialRequest) (*SenderCredential, error)
- func (UnimplementedSMSAPIServer) SendSMS(context.Context, *SendSMSRequest) (*empty.Empty, error)
- 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 Cookie ¶
type 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 (*Cookie) Descriptor
deprecated
func (*Cookie) ProtoMessage ¶
func (*Cookie) ProtoMessage()
func (*Cookie) ProtoReflect ¶
func (x *Cookie) ProtoReflect() protoreflect.Message
type CreateSenderCredentialsRequest ¶
type CreateSenderCredentialsRequest struct { Credential *SenderCredential `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` // contains filtered or unexported fields }
func (*CreateSenderCredentialsRequest) Descriptor
deprecated
func (*CreateSenderCredentialsRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateSenderCredentialsRequest.ProtoReflect.Descriptor instead.
func (*CreateSenderCredentialsRequest) GetCredential ¶
func (x *CreateSenderCredentialsRequest) GetCredential() *SenderCredential
func (*CreateSenderCredentialsRequest) ProtoMessage ¶
func (*CreateSenderCredentialsRequest) ProtoMessage()
func (*CreateSenderCredentialsRequest) ProtoReflect ¶
func (x *CreateSenderCredentialsRequest) ProtoReflect() protoreflect.Message
func (*CreateSenderCredentialsRequest) Reset ¶
func (x *CreateSenderCredentialsRequest) Reset()
func (*CreateSenderCredentialsRequest) String ¶
func (x *CreateSenderCredentialsRequest) String() string
type GetSenderCredentialRequest ¶
type GetSenderCredentialRequest struct { CredentialId string `protobuf:"bytes,1,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` UseProjectId bool `protobuf:"varint,2,opt,name=use_project_id,json=useProjectId,proto3" json:"use_project_id,omitempty"` // contains filtered or unexported fields }
func (*GetSenderCredentialRequest) Descriptor
deprecated
func (*GetSenderCredentialRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSenderCredentialRequest.ProtoReflect.Descriptor instead.
func (*GetSenderCredentialRequest) GetCredentialId ¶
func (x *GetSenderCredentialRequest) GetCredentialId() string
func (*GetSenderCredentialRequest) GetUseProjectId ¶
func (x *GetSenderCredentialRequest) GetUseProjectId() bool
func (*GetSenderCredentialRequest) ProtoMessage ¶
func (*GetSenderCredentialRequest) ProtoMessage()
func (*GetSenderCredentialRequest) ProtoReflect ¶
func (x *GetSenderCredentialRequest) ProtoReflect() protoreflect.Message
func (*GetSenderCredentialRequest) Reset ¶
func (x *GetSenderCredentialRequest) Reset()
func (*GetSenderCredentialRequest) String ¶
func (x *GetSenderCredentialRequest) String() string
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) // Create a sender id credential CreateSenderCredential(ctx context.Context, in *CreateSenderCredentialsRequest, opts ...grpc.CallOption) (*empty.Empty, error) // Get a sender id credential GetSenderCredential(ctx context.Context, in *GetSenderCredentialRequest, opts ...grpc.CallOption) (*SenderCredential, 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) // Create a sender id credential CreateSenderCredential(context.Context, *CreateSenderCredentialsRequest) (*empty.Empty, error) // Get a sender id credential GetSenderCredential(context.Context, *GetSenderCredentialRequest) (*SenderCredential, error) // contains filtered or unexported methods }
SMSAPIServer is the server API for SMSAPI service. All implementations must embed UnimplementedSMSAPIServer for forward compatibility
type SMSAuth ¶
type 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 []*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 (*SMSAuth) Descriptor
deprecated
func (*SMSAuth) GetAccessKey ¶
func (*SMSAuth) GetAppName ¶
func (*SMSAuth) GetAuthToken ¶
func (*SMSAuth) GetClientId ¶
func (*SMSAuth) GetCookies ¶
func (*SMSAuth) GetSenderId ¶
func (*SMSAuth) ProtoMessage ¶
func (*SMSAuth) ProtoMessage()
func (*SMSAuth) ProtoReflect ¶
func (x *SMSAuth) ProtoReflect() protoreflect.Message
type SendSMSRequest ¶
type SendSMSRequest struct { Sms *SMS `protobuf:"bytes,1,opt,name=sms,proto3" json:"sms,omitempty"` Auth *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"` ProjectId string `protobuf:"bytes,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` FetchSender bool `protobuf:"varint,5,opt,name=fetch_sender,json=fetchSender,proto3" json:"fetch_sender,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() *SMSAuth
func (*SendSMSRequest) GetFetchSender ¶
func (x *SendSMSRequest) GetFetchSender() bool
func (*SendSMSRequest) GetProjectId ¶
func (x *SendSMSRequest) GetProjectId() string
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 SenderCredential ¶
type SenderCredential struct { CredentialId string `protobuf:"bytes,1,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` Auth *SMSAuth `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"` // contains filtered or unexported fields }
func (*SenderCredential) Descriptor
deprecated
func (*SenderCredential) Descriptor() ([]byte, []int)
Deprecated: Use SenderCredential.ProtoReflect.Descriptor instead.
func (*SenderCredential) GetAuth ¶
func (x *SenderCredential) GetAuth() *SMSAuth
func (*SenderCredential) GetCredentialId ¶
func (x *SenderCredential) GetCredentialId() string
func (*SenderCredential) GetProjectId ¶
func (x *SenderCredential) GetProjectId() string
func (*SenderCredential) ProtoMessage ¶
func (*SenderCredential) ProtoMessage()
func (*SenderCredential) ProtoReflect ¶
func (x *SenderCredential) ProtoReflect() protoreflect.Message
func (*SenderCredential) Reset ¶
func (x *SenderCredential) Reset()
func (*SenderCredential) String ¶
func (x *SenderCredential) 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) CreateSenderCredential ¶
func (UnimplementedSMSAPIServer) CreateSenderCredential(context.Context, *CreateSenderCredentialsRequest) (*empty.Empty, error)
func (UnimplementedSMSAPIServer) GetSenderCredential ¶
func (UnimplementedSMSAPIServer) GetSenderCredential(context.Context, *GetSenderCredentialRequest) (*SenderCredential, error)
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.