protobuf

package
v0.0.0-...-fa223cd Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package protobuf is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Email_List_FullMethodName   = "/go.micro.service.email.Email/List"
	Email_Create_FullMethodName = "/go.micro.service.email.Email/Create"
	Email_Get_FullMethodName    = "/go.micro.service.email.Email/Get"
	Email_Update_FullMethodName = "/go.micro.service.email.Email/Update"
	Email_Delete_FullMethodName = "/go.micro.service.email.Email/Delete"
)

Variables

View Source
var Email_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go.micro.service.email.Email",
	HandlerType: (*EmailServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Email_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Email_Get_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Email_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Email_Delete_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "List",
			Handler:       _Email_List_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "services/email/protobuf/email.proto",
}

Email_ServiceDesc is the grpc.ServiceDesc for Email 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_services_email_protobuf_email_proto protoreflect.FileDescriptor

Functions

func RegisterEmailHandler

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

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

func RegisterEmailHandlerClient

func RegisterEmailHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EmailClient) error

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

func RegisterEmailHandlerFromEndpoint

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

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

func RegisterEmailHandlerServer

func RegisterEmailHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EmailServer) error

RegisterEmailHandlerServer registers the http handlers for service Email to "mux". UnaryRPC :call EmailServer 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 RegisterEmailHandlerFromEndpoint instead.

func RegisterEmailServer

func RegisterEmailServer(s grpc.ServiceRegistrar, srv EmailServer)

Types

type EmailClient

type EmailClient interface {
	List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Email_ListClient, error)
	Create(ctx context.Context, in *EmailCreateParams, opts ...grpc.CallOption) (*EmailResponse, error)
	Get(ctx context.Context, in *EmailEntity, opts ...grpc.CallOption) (*EmailResponse, error)
	Update(ctx context.Context, in *EmailUpdateParams, opts ...grpc.CallOption) (*protobuf.Response, error)
	Delete(ctx context.Context, in *EmailEntity, opts ...grpc.CallOption) (*protobuf.Response, error)
}

EmailClient is the client API for Email 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 NewEmailClient

func NewEmailClient(cc grpc.ClientConnInterface) EmailClient

type EmailCreateParams

type EmailCreateParams struct {
	PeopleId string `protobuf:"bytes,1,opt,name=people_id,json=peopleId,proto3" json:"people_id" db:"people_id"` // @gotags: json:"people_id" db:"people_id"
	Email    string `protobuf:"bytes,2,opt,name=email,proto3" json:"email" db:"email"`                           // @gotags: json:"email" db:"email"
	Status   string `protobuf:"bytes,3,opt,name=status,proto3" json:"status" db:"status"`                        // @gotags: json:"status" db:"status"
	// contains filtered or unexported fields
}

func (*EmailCreateParams) Descriptor deprecated

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

Deprecated: Use EmailCreateParams.ProtoReflect.Descriptor instead.

func (*EmailCreateParams) GetEmail

func (x *EmailCreateParams) GetEmail() string

func (*EmailCreateParams) GetPeopleId

func (x *EmailCreateParams) GetPeopleId() string

func (*EmailCreateParams) GetStatus

func (x *EmailCreateParams) GetStatus() string

func (*EmailCreateParams) ProtoMessage

func (*EmailCreateParams) ProtoMessage()

func (*EmailCreateParams) ProtoReflect

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

func (*EmailCreateParams) Reset

func (x *EmailCreateParams) Reset()

func (*EmailCreateParams) String

func (x *EmailCreateParams) String() string

type EmailEntity

type EmailEntity struct {
	PeopleId string `protobuf:"bytes,1,opt,name=people_id,json=peopleId,proto3" json:"people_id" db:"people_id"` // @gotags: json:"people_id" db:"people_id"
	Email    string `protobuf:"bytes,2,opt,name=email,proto3" json:"email" db:"email"`                           // @gotags: json:"email" db:"email"
	// contains filtered or unexported fields
}

func (*EmailEntity) Descriptor deprecated

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

Deprecated: Use EmailEntity.ProtoReflect.Descriptor instead.

func (*EmailEntity) GetEmail

func (x *EmailEntity) GetEmail() string

func (*EmailEntity) GetPeopleId

func (x *EmailEntity) GetPeopleId() string

func (*EmailEntity) ProtoMessage

func (*EmailEntity) ProtoMessage()

func (*EmailEntity) ProtoReflect

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

func (*EmailEntity) Reset

func (x *EmailEntity) Reset()

func (*EmailEntity) String

func (x *EmailEntity) String() string

type EmailResponse

type EmailResponse struct {
	PeopleId    string                 `protobuf:"bytes,1,opt,name=people_id,json=peopleId,proto3" json:"people_id" db:"people_id"`             // @gotags: json:"people_id" db:"people_id"
	Status      string                 `protobuf:"bytes,2,opt,name=status,proto3" json:"status" db:"status"`                                    // @gotags: json:"status" db:"status"
	CreatedAt   *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at" db:"created_at"`         // @gotags: json:"created_at" db:"created_at"
	UpdatedAt   *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at" db:"updated_at"`         // @gotags: json:"updated_at" db:"updated_at"
	ValidatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=validated_at,json=validatedAt,proto3" json:"validated_at" db:"validated_at"` // @gotags: json:"validated_at" db:"validated_at"
	ExpiredAt   *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at" db:"expired_at"`         // @gotags: json:"expired_at" db:"expired_at"
	Email       string                 `protobuf:"bytes,7,opt,name=email,proto3" json:"email" db:"email"`                                       // @gotags: json:"email" db:"email"
	// contains filtered or unexported fields
}

func (*EmailResponse) Descriptor deprecated

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

Deprecated: Use EmailResponse.ProtoReflect.Descriptor instead.

func (*EmailResponse) GetCreatedAt

func (x *EmailResponse) GetCreatedAt() *timestamppb.Timestamp

func (*EmailResponse) GetEmail

func (x *EmailResponse) GetEmail() string

func (*EmailResponse) GetExpiredAt

func (x *EmailResponse) GetExpiredAt() *timestamppb.Timestamp

func (*EmailResponse) GetPeopleId

func (x *EmailResponse) GetPeopleId() string

func (*EmailResponse) GetStatus

func (x *EmailResponse) GetStatus() string

func (*EmailResponse) GetUpdatedAt

func (x *EmailResponse) GetUpdatedAt() *timestamppb.Timestamp

func (*EmailResponse) GetValidatedAt

func (x *EmailResponse) GetValidatedAt() *timestamppb.Timestamp

func (*EmailResponse) ProtoMessage

func (*EmailResponse) ProtoMessage()

func (*EmailResponse) ProtoReflect

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

func (*EmailResponse) Reset

func (x *EmailResponse) Reset()

func (*EmailResponse) String

func (x *EmailResponse) String() string

type EmailServer

type EmailServer interface {
	List(*emptypb.Empty, Email_ListServer) error
	Create(context.Context, *EmailCreateParams) (*EmailResponse, error)
	Get(context.Context, *EmailEntity) (*EmailResponse, error)
	Update(context.Context, *EmailUpdateParams) (*protobuf.Response, error)
	Delete(context.Context, *EmailEntity) (*protobuf.Response, error)
	// contains filtered or unexported methods
}

EmailServer is the server API for Email service. All implementations must embed UnimplementedEmailServer for forward compatibility

type EmailUpdateParams

type EmailUpdateParams struct {
	PeopleId    string                 `protobuf:"bytes,1,opt,name=people_id,json=peopleId,proto3" json:"people_id" db:"people_id"`             // @gotags: json:"people_id" db:"people_id"
	Status      string                 `protobuf:"bytes,2,opt,name=status,proto3" json:"status" db:"status"`                                    // @gotags: json:"status" db:"status"
	ValidatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=validated_at,json=validatedAt,proto3" json:"validated_at" db:"validated_at"` // @gotags: json:"validated_at" db:"validated_at"
	ExpiredAt   *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at" db:"expired_at"`         // @gotags: json:"expired_at" db:"expired_at"
	Email       string                 `protobuf:"bytes,5,opt,name=email,proto3" json:"email" db:"email"`                                       // @gotags: json:"email" db:"email"
	// contains filtered or unexported fields
}

func (*EmailUpdateParams) Descriptor deprecated

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

Deprecated: Use EmailUpdateParams.ProtoReflect.Descriptor instead.

func (*EmailUpdateParams) GetEmail

func (x *EmailUpdateParams) GetEmail() string

func (*EmailUpdateParams) GetExpiredAt

func (x *EmailUpdateParams) GetExpiredAt() *timestamppb.Timestamp

func (*EmailUpdateParams) GetPeopleId

func (x *EmailUpdateParams) GetPeopleId() string

func (*EmailUpdateParams) GetStatus

func (x *EmailUpdateParams) GetStatus() string

func (*EmailUpdateParams) GetValidatedAt

func (x *EmailUpdateParams) GetValidatedAt() *timestamppb.Timestamp

func (*EmailUpdateParams) ProtoMessage

func (*EmailUpdateParams) ProtoMessage()

func (*EmailUpdateParams) ProtoReflect

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

func (*EmailUpdateParams) Reset

func (x *EmailUpdateParams) Reset()

func (*EmailUpdateParams) String

func (x *EmailUpdateParams) String() string

type Email_ListClient

type Email_ListClient interface {
	Recv() (*EmailResponse, error)
	grpc.ClientStream
}

type Email_ListServer

type Email_ListServer interface {
	Send(*EmailResponse) error
	grpc.ServerStream
}

type UnimplementedEmailServer

type UnimplementedEmailServer struct {
}

UnimplementedEmailServer must be embedded to have forward compatible implementations.

func (UnimplementedEmailServer) Create

func (UnimplementedEmailServer) Delete

func (UnimplementedEmailServer) Get

func (UnimplementedEmailServer) List

func (UnimplementedEmailServer) Update

type UnsafeEmailServer

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

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

Jump to

Keyboard shortcuts

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