call

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package call is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

Functions

func RegisterCallAPIHandler

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

RegisterCallAPIHandler registers the http handlers for service CallAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCallAPIHandlerClient

func RegisterCallAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CallAPIClient) error

RegisterCallAPIHandlerClient registers the http handlers for service CallAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CallAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CallAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CallAPIClient" to call the correct interceptors.

func RegisterCallAPIHandlerFromEndpoint

func RegisterCallAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCallAPIHandlerFromEndpoint is same as RegisterCallAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCallAPIHandlerServer

func RegisterCallAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CallAPIServer) error

RegisterCallAPIHandlerServer registers the http handlers for service CallAPI to "mux". UnaryRPC :call CallAPIServer 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 RegisterCallAPIHandlerFromEndpoint instead.

func RegisterCallAPIServer

func RegisterCallAPIServer(s grpc.ServiceRegistrar, srv CallAPIServer)

Types

type CallAPIClient

type CallAPIClient interface {
	// Calls a user programmatically
	Call(ctx context.Context, in *CallPayload, opts ...grpc.CallOption) (*empty.Empty, error)
}

CallAPIClient is the client API for CallAPI 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 NewCallAPIClient

func NewCallAPIClient(cc grpc.ClientConnInterface) CallAPIClient

type CallAPIServer

type CallAPIServer interface {
	// Calls a user programmatically
	Call(context.Context, *CallPayload) (*empty.Empty, error)
	// contains filtered or unexported methods
}

CallAPIServer is the server API for CallAPI service. All implementations must embed UnimplementedCallAPIServer for forward compatibility

type CallPayload

type CallPayload 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 (*CallPayload) Descriptor deprecated

func (*CallPayload) Descriptor() ([]byte, []int)

Deprecated: Use CallPayload.ProtoReflect.Descriptor instead.

func (*CallPayload) GetDestinationPhones

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

func (*CallPayload) GetKeyword

func (x *CallPayload) GetKeyword() string

func (*CallPayload) GetMessage

func (x *CallPayload) GetMessage() string

func (*CallPayload) ProtoMessage

func (*CallPayload) ProtoMessage()

func (*CallPayload) ProtoReflect

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

func (*CallPayload) Reset

func (x *CallPayload) Reset()

func (*CallPayload) String

func (x *CallPayload) String() string

type UnimplementedCallAPIServer

type UnimplementedCallAPIServer struct {
}

UnimplementedCallAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedCallAPIServer) Call

type UnsafeCallAPIServer

type UnsafeCallAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeCallAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CallAPIServer will result in compilation errors.

Jump to

Keyboard shortcuts

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