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 (
	People_List_FullMethodName   = "/go.micro.service.people.People/List"
	People_Create_FullMethodName = "/go.micro.service.people.People/Create"
	People_Get_FullMethodName    = "/go.micro.service.people.People/Get"
	People_Update_FullMethodName = "/go.micro.service.people.People/Update"
	People_Delete_FullMethodName = "/go.micro.service.people.People/Delete"
)

Variables

View Source
var File_services_people_protobuf_people_proto protoreflect.FileDescriptor
View Source
var People_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go.micro.service.people.People",
	HandlerType: (*PeopleServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _People_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _People_Get_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _People_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _People_Delete_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "List",
			Handler:       _People_List_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "services/people/protobuf/people.proto",
}

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

Functions

func RegisterPeopleHandler

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

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

func RegisterPeopleHandlerClient

func RegisterPeopleHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PeopleClient) error

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

func RegisterPeopleHandlerFromEndpoint

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

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

func RegisterPeopleHandlerServer

func RegisterPeopleHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PeopleServer) error

RegisterPeopleHandlerServer registers the http handlers for service People to "mux". UnaryRPC :call PeopleServer 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 RegisterPeopleHandlerFromEndpoint instead.

func RegisterPeopleServer

func RegisterPeopleServer(s grpc.ServiceRegistrar, srv PeopleServer)

Types

type PeopleClient

PeopleClient is the client API for People 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 NewPeopleClient

func NewPeopleClient(cc grpc.ClientConnInterface) PeopleClient

type PeopleCreateParams

type PeopleCreateParams struct {
	Firstname string `protobuf:"bytes,1,opt,name=firstname,proto3" json:"firstname" db:"firstname" validate:"required,alphanumunicode"` // @gotags: json:"firstname" db:"firstname" validate:"required,alphanumunicode"`
	Lastname  string `protobuf:"bytes,2,opt,name=lastname,proto3" json:"lastname" db:"lastname" validate:"required,alphanumunicode"`    // @gotags: json:"lastname" db:"lastname" validate:"required,alphanumunicode"`
	Birthday  string `protobuf:"bytes,3,opt,name=birthday,proto3" json:"birthday" db:"birthday" validate:"required"`                    // @gotags: json:"birthday" db:"birthday" validate:"required"`
	// contains filtered or unexported fields
}

func (*PeopleCreateParams) Descriptor deprecated

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

Deprecated: Use PeopleCreateParams.ProtoReflect.Descriptor instead.

func (*PeopleCreateParams) GetBirthday

func (x *PeopleCreateParams) GetBirthday() string

func (*PeopleCreateParams) GetFirstname

func (x *PeopleCreateParams) GetFirstname() string

func (*PeopleCreateParams) GetLastname

func (x *PeopleCreateParams) GetLastname() string

func (*PeopleCreateParams) ProtoMessage

func (*PeopleCreateParams) ProtoMessage()

func (*PeopleCreateParams) ProtoReflect

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

func (*PeopleCreateParams) Reset

func (x *PeopleCreateParams) Reset()

func (*PeopleCreateParams) String

func (x *PeopleCreateParams) String() string

type PeopleResponse

type PeopleResponse struct {
	Id        string                 `protobuf:"bytes,1,opt,name=Id,proto3" json:"id" db:"id"`                        // @gotags: json:"id" db:"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=CreatedAt,proto3" json:"created_at" db:"created_at"` // @gotags: json:"created_at" db:"created_at"
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=UpdatedAt,proto3" json:"updated_at" db:"updated_at"` // @gotags: json:"updated_at" db:"updated_at"
	ExpiredAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=ExpiredAt,proto3" json:"expired_at" db:"expired_at"` // @gotags: json:"expired_at" db:"expired_at"
	Firstname string                 `protobuf:"bytes,6,opt,name=Firstname,proto3" json:"firstname" db:"firstname"`   // @gotags: json:"firstname" db:"firstname"
	Lastname  string                 `protobuf:"bytes,7,opt,name=Lastname,proto3" json:"lastname" db:"lastname"`      // @gotags: json:"lastname" db:"lastname"
	Birthday  string                 `protobuf:"bytes,8,opt,name=Birthday,proto3" json:"birthday" db:"birthday"`      // @gotags: json:"birthday" db:"birthday"
	// contains filtered or unexported fields
}

func (*PeopleResponse) Descriptor deprecated

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

Deprecated: Use PeopleResponse.ProtoReflect.Descriptor instead.

func (*PeopleResponse) GetBirthday

func (x *PeopleResponse) GetBirthday() string

func (*PeopleResponse) GetCreatedAt

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

func (*PeopleResponse) GetExpiredAt

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

func (*PeopleResponse) GetFirstname

func (x *PeopleResponse) GetFirstname() string

func (*PeopleResponse) GetId

func (x *PeopleResponse) GetId() string

func (*PeopleResponse) GetLastname

func (x *PeopleResponse) GetLastname() string

func (*PeopleResponse) GetStatus

func (x *PeopleResponse) GetStatus() string

func (*PeopleResponse) GetUpdatedAt

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

func (*PeopleResponse) ProtoMessage

func (*PeopleResponse) ProtoMessage()

func (*PeopleResponse) ProtoReflect

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

func (*PeopleResponse) Reset

func (x *PeopleResponse) Reset()

func (*PeopleResponse) String

func (x *PeopleResponse) String() string

type PeopleServer

PeopleServer is the server API for People service. All implementations must embed UnimplementedPeopleServer for forward compatibility

type PeopleUpdateParams

type PeopleUpdateParams struct {
	Id         string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id" db:"id" validate:"required,uuid4_rfc4122"`                        // @gotags: json:"id" db:"id" validate:"required,uuid4_rfc4122"`
	Status     string                 `protobuf:"bytes,2,opt,name=Status,proto3" json:"status" db:"status" validate:"required,alpha"`                    // @gotags: json:"status" db:"status" validate:"required,alpha"`
	ExpireddAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=ExpireddAt,proto3" json:"expired_at" db:"expired_at"`                                  // @gotags: json:"expired_at" db:"expired_at"
	Firstname  string                 `protobuf:"bytes,4,opt,name=firstname,proto3" json:"firstname" db:"firstname" validate:"required,alphanumunicode"` // @gotags: json:"firstname" db:"firstname" validate:"required,alphanumunicode"`
	Lastname   string                 `protobuf:"bytes,5,opt,name=lastname,proto3" json:"lastname" db:"lastname" validate:"required,alphanumunicode"`    // @gotags: json:"lastname" db:"lastname" validate:"required,alphanumunicode"`
	Birthday   string                 `protobuf:"bytes,6,opt,name=birthday,proto3" json:"birthday" db:"birthday" validate:"required"`                    // @gotags: json:"birthday" db:"birthday" validate:"required"`
	// contains filtered or unexported fields
}

func (*PeopleUpdateParams) Descriptor deprecated

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

Deprecated: Use PeopleUpdateParams.ProtoReflect.Descriptor instead.

func (*PeopleUpdateParams) GetBirthday

func (x *PeopleUpdateParams) GetBirthday() string

func (*PeopleUpdateParams) GetExpireddAt

func (x *PeopleUpdateParams) GetExpireddAt() *timestamppb.Timestamp

func (*PeopleUpdateParams) GetFirstname

func (x *PeopleUpdateParams) GetFirstname() string

func (*PeopleUpdateParams) GetId

func (x *PeopleUpdateParams) GetId() string

func (*PeopleUpdateParams) GetLastname

func (x *PeopleUpdateParams) GetLastname() string

func (*PeopleUpdateParams) GetStatus

func (x *PeopleUpdateParams) GetStatus() string

func (*PeopleUpdateParams) ProtoMessage

func (*PeopleUpdateParams) ProtoMessage()

func (*PeopleUpdateParams) ProtoReflect

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

func (*PeopleUpdateParams) Reset

func (x *PeopleUpdateParams) Reset()

func (*PeopleUpdateParams) String

func (x *PeopleUpdateParams) String() string

type People_ListClient

type People_ListClient interface {
	Recv() (*PeopleResponse, error)
	grpc.ClientStream
}

type People_ListServer

type People_ListServer interface {
	Send(*PeopleResponse) error
	grpc.ServerStream
}

type UnimplementedPeopleServer

type UnimplementedPeopleServer struct {
}

UnimplementedPeopleServer must be embedded to have forward compatible implementations.

func (UnimplementedPeopleServer) Create

func (UnimplementedPeopleServer) Delete

func (UnimplementedPeopleServer) Get

func (UnimplementedPeopleServer) List

func (UnimplementedPeopleServer) Update

type UnsafePeopleServer

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

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

Jump to

Keyboard shortcuts

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