sms

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package sms is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

Functions

func RegisterSMSAPIHandler

func RegisterSMSAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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

Deprecated: Use SMS.ProtoReflect.Descriptor instead.

func (*SMS) GetDestinationPhones

func (x *SMS) GetDestinationPhones() []string

func (*SMS) GetKeyword

func (x *SMS) GetKeyword() string

func (*SMS) GetMessage

func (x *SMS) GetMessage() string

func (*SMS) ProtoMessage

func (*SMS) ProtoMessage()

func (*SMS) ProtoReflect

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

func (*SMS) Reset

func (x *SMS) Reset()

func (*SMS) String

func (x *SMS) String() string

type SMSAPIClient

type SMSAPIClient interface {
	// Send an sms to its destination(s)
	SendSMS(ctx context.Context, in *SMS, 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, *SMS) (*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 UnimplementedSMSAPIServer

type UnimplementedSMSAPIServer struct {
}

UnimplementedSMSAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedSMSAPIServer) SendSMS

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.

Jump to

Keyboard shortcuts

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