call

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 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.

func RegisterCallAPIServer

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

CallAPIServer is the server API for CallAPI service.

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 can be embedded to have forward compatible implementations.

func (*UnimplementedCallAPIServer) Call

Jump to

Keyboard shortcuts

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