sms

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 18 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.

func RegisterSMSAPIServer

func RegisterSMSAPIServer(s *grpc.Server, 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://godoc.org/google.golang.org/grpc#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)
}

SMSAPIServer is the server API for SMSAPI service.

type UnimplementedSMSAPIServer

type UnimplementedSMSAPIServer struct {
}

UnimplementedSMSAPIServer can be embedded to have forward compatible implementations.

func (*UnimplementedSMSAPIServer) SendSMS

Jump to

Keyboard shortcuts

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