postarv1

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package postarv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EmailService_SendEmail_FullMethodName = "/postar.v1.EmailService/SendEmail"
)

Variables

View Source
var EmailService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "postar.v1.EmailService",
	HandlerType: (*EmailServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendEmail",
			Handler:    _EmailService_SendEmail_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "postar/v1/email_service.proto",
}

EmailService_ServiceDesc is the grpc.ServiceDesc for EmailService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_postar_v1_email_proto protoreflect.FileDescriptor
View Source
var File_postar_v1_email_service_proto protoreflect.FileDescriptor

Functions

func RegisterEmailServiceHandler

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

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

func RegisterEmailServiceHandlerClient

func RegisterEmailServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EmailServiceClient) error

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

func RegisterEmailServiceHandlerFromEndpoint

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

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

func RegisterEmailServiceHandlerServer

func RegisterEmailServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EmailServiceServer) error

RegisterEmailServiceHandlerServer registers the http handlers for service EmailService to "mux". UnaryRPC :call EmailServiceServer 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 RegisterEmailServiceHandlerFromEndpoint instead.

func RegisterEmailServiceServer

func RegisterEmailServiceServer(s grpc.ServiceRegistrar, srv EmailServiceServer)

Types

type Email

type Email struct {
	TemplateId    int64             `protobuf:"varint,1,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"`
	To            []string          `protobuf:"bytes,2,rep,name=to,proto3" json:"to,omitempty"`
	Cc            []string          `protobuf:"bytes,3,rep,name=cc,proto3" json:"cc,omitempty"`
	Bcc           []string          `protobuf:"bytes,4,rep,name=bcc,proto3" json:"bcc,omitempty"`
	SubjectParams map[string]string `` /* 188-byte string literal not displayed */
	ContentParams map[string]string `` /* 188-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Email) Descriptor deprecated

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

Deprecated: Use Email.ProtoReflect.Descriptor instead.

func (*Email) GetBcc

func (x *Email) GetBcc() []string

func (*Email) GetCc

func (x *Email) GetCc() []string

func (*Email) GetContentParams

func (x *Email) GetContentParams() map[string]string

func (*Email) GetSubjectParams

func (x *Email) GetSubjectParams() map[string]string

func (*Email) GetTemplateId

func (x *Email) GetTemplateId() int64

func (*Email) GetTo

func (x *Email) GetTo() []string

func (*Email) ProtoMessage

func (*Email) ProtoMessage()

func (*Email) ProtoReflect

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

func (*Email) Reset

func (x *Email) Reset()

func (*Email) String

func (x *Email) String() string

type EmailServiceClient

type EmailServiceClient interface {
	SendEmail(ctx context.Context, in *SendEmailRequest, opts ...grpc.CallOption) (*SendEmailResponse, error)
}

EmailServiceClient is the client API for EmailService 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.

type EmailServiceServer

type EmailServiceServer interface {
	SendEmail(context.Context, *SendEmailRequest) (*SendEmailResponse, error)
	// contains filtered or unexported methods
}

EmailServiceServer is the server API for EmailService service. All implementations must embed UnimplementedEmailServiceServer for forward compatibility

type SendEmailRequest

type SendEmailRequest struct {
	Email *Email `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*SendEmailRequest) Descriptor deprecated

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

Deprecated: Use SendEmailRequest.ProtoReflect.Descriptor instead.

func (*SendEmailRequest) GetEmail

func (x *SendEmailRequest) GetEmail() *Email

func (*SendEmailRequest) ProtoMessage

func (*SendEmailRequest) ProtoMessage()

func (*SendEmailRequest) ProtoReflect

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

func (*SendEmailRequest) Reset

func (x *SendEmailRequest) Reset()

func (*SendEmailRequest) String

func (x *SendEmailRequest) String() string

type SendEmailResponse

type SendEmailResponse struct {
	// contains filtered or unexported fields
}

func (*SendEmailResponse) Descriptor deprecated

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

Deprecated: Use SendEmailResponse.ProtoReflect.Descriptor instead.

func (*SendEmailResponse) ProtoMessage

func (*SendEmailResponse) ProtoMessage()

func (*SendEmailResponse) ProtoReflect

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

func (*SendEmailResponse) Reset

func (x *SendEmailResponse) Reset()

func (*SendEmailResponse) String

func (x *SendEmailResponse) String() string

type UnimplementedEmailServiceServer

type UnimplementedEmailServiceServer struct {
}

UnimplementedEmailServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedEmailServiceServer) SendEmail

type UnsafeEmailServiceServer

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

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

Jump to

Keyboard shortcuts

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