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 (
	Account_List_FullMethodName   = "/go.micro.service.account.Account/List"
	Account_Create_FullMethodName = "/go.micro.service.account.Account/Create"
	Account_Get_FullMethodName    = "/go.micro.service.account.Account/Get"
	Account_Update_FullMethodName = "/go.micro.service.account.Account/Update"
	Account_Delete_FullMethodName = "/go.micro.service.account.Account/Delete"
)

Variables

View Source
var Account_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go.micro.service.account.Account",
	HandlerType: (*AccountServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Account_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Account_Get_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Account_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Account_Delete_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "List",
			Handler:       _Account_List_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "services/account/protobuf/account.proto",
}

Account_ServiceDesc is the grpc.ServiceDesc for Account 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_account_protobuf_account_proto protoreflect.FileDescriptor

Functions

func RegisterAccountHandler

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

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

func RegisterAccountHandlerClient

func RegisterAccountHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountClient) error

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

func RegisterAccountHandlerFromEndpoint

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

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

func RegisterAccountHandlerServer

func RegisterAccountHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountServer) error

RegisterAccountHandlerServer registers the http handlers for service Account to "mux". UnaryRPC :call AccountServer 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 RegisterAccountHandlerFromEndpoint instead.

func RegisterAccountServer

func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer)

Types

type AccountClient

type AccountClient interface {
	List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Account_ListClient, error)
	Create(ctx context.Context, in *AccountCreateParams, opts ...grpc.CallOption) (*AccountResponse, error)
	Get(ctx context.Context, in *AccountEntity, opts ...grpc.CallOption) (*AccountResponse, error)
	Update(ctx context.Context, in *AccountUpdateParams, opts ...grpc.CallOption) (*protobuf.Response, error)
	Delete(ctx context.Context, in *AccountEntity, opts ...grpc.CallOption) (*protobuf.Response, error)
}

AccountClient is the client API for Account 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 NewAccountClient

func NewAccountClient(cc grpc.ClientConnInterface) AccountClient

type AccountCreateParams

type AccountCreateParams struct {
	PeopleId string `protobuf:"bytes,1,opt,name=people_id,json=peopleId,proto3" json:"people_id" db:"people_id" validate:"required,uuid4_rfc4122"` // @gotags: json:"people_id" db:"people_id" validate:"required,uuid4_rfc4122"`
	SigninId string `protobuf:"bytes,2,opt,name=signin_id,json=signinId,proto3" json:"signin_id" db:"sigmin_id" validate:"required,uuid4_rfc4122"` // @gotags: json:"signin_id" db:"sigmin_id" validate:"required,uuid4_rfc4122"`
	Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password" db:"password" validate:"required"`                                // @gotags: json:"password" db:"password" validate:"required"`
	Email    string `protobuf:"bytes,4,opt,name=email,proto3" json:"email" db:"email" validate:"required,email"`                                   // @gotags: json:"email" db:"email" validate:"required,email"`
	Status   string `protobuf:"bytes,5,opt,name=status,proto3" json:"status" db:"status" validate:"required,alphanumunicode"`                      // @gotags: json:"status" db:"status" validate:"required,alphanumunicode"`
	// contains filtered or unexported fields
}

func (*AccountCreateParams) Descriptor deprecated

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

Deprecated: Use AccountCreateParams.ProtoReflect.Descriptor instead.

func (*AccountCreateParams) GetEmail

func (x *AccountCreateParams) GetEmail() string

func (*AccountCreateParams) GetPassword

func (x *AccountCreateParams) GetPassword() string

func (*AccountCreateParams) GetPeopleId

func (x *AccountCreateParams) GetPeopleId() string

func (*AccountCreateParams) GetSigninId

func (x *AccountCreateParams) GetSigninId() string

func (*AccountCreateParams) GetStatus

func (x *AccountCreateParams) GetStatus() string

func (*AccountCreateParams) ProtoMessage

func (*AccountCreateParams) ProtoMessage()

func (*AccountCreateParams) ProtoReflect

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

func (*AccountCreateParams) Reset

func (x *AccountCreateParams) Reset()

func (*AccountCreateParams) String

func (x *AccountCreateParams) String() string

type AccountEntity

type AccountEntity 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"
	// contains filtered or unexported fields
}

func (*AccountEntity) Descriptor deprecated

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

Deprecated: Use AccountEntity.ProtoReflect.Descriptor instead.

func (*AccountEntity) GetPeopleId

func (x *AccountEntity) GetPeopleId() string

func (*AccountEntity) ProtoMessage

func (*AccountEntity) ProtoMessage()

func (*AccountEntity) ProtoReflect

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

func (*AccountEntity) Reset

func (x *AccountEntity) Reset()

func (*AccountEntity) String

func (x *AccountEntity) String() string

type AccountResponse

type AccountResponse 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"
	Password    string                 `protobuf:"bytes,8,opt,name=password,proto3" json:"password" db:"password"`                              // @gotags: json:"password" db:"password"
	SigninId    string                 `protobuf:"bytes,9,opt,name=signin_id,json=signinId,proto3" json:"signin_id" db:"signin_id"`             // @gotags: json:"signin_id" db:"signin_id"
	// contains filtered or unexported fields
}

func (*AccountResponse) Descriptor deprecated

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

Deprecated: Use AccountResponse.ProtoReflect.Descriptor instead.

func (*AccountResponse) GetCreatedAt

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

func (*AccountResponse) GetEmail

func (x *AccountResponse) GetEmail() string

func (*AccountResponse) GetExpiredAt

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

func (*AccountResponse) GetPassword

func (x *AccountResponse) GetPassword() string

func (*AccountResponse) GetPeopleId

func (x *AccountResponse) GetPeopleId() string

func (*AccountResponse) GetSigninId

func (x *AccountResponse) GetSigninId() string

func (*AccountResponse) GetStatus

func (x *AccountResponse) GetStatus() string

func (*AccountResponse) GetUpdatedAt

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

func (*AccountResponse) GetValidatedAt

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

func (*AccountResponse) ProtoMessage

func (*AccountResponse) ProtoMessage()

func (*AccountResponse) ProtoReflect

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

func (*AccountResponse) Reset

func (x *AccountResponse) Reset()

func (*AccountResponse) String

func (x *AccountResponse) String() string

type AccountServer

type AccountServer interface {
	List(*emptypb.Empty, Account_ListServer) error
	Create(context.Context, *AccountCreateParams) (*AccountResponse, error)
	Get(context.Context, *AccountEntity) (*AccountResponse, error)
	Update(context.Context, *AccountUpdateParams) (*protobuf.Response, error)
	Delete(context.Context, *AccountEntity) (*protobuf.Response, error)
	// contains filtered or unexported methods
}

AccountServer is the server API for Account service. All implementations must embed UnimplementedAccountServer for forward compatibility

type AccountUpdateParams

type AccountUpdateParams struct {
	PeopleId    string                 `protobuf:"bytes,1,opt,name=people_id,json=peopleId,proto3" json:"people_id" db:"people_id" validate:"required,uuid4_rfc4122"` // @gotags: json:"people_id" db:"people_id" validate:"required,uuid4_rfc4122"`
	Status      string                 `protobuf:"bytes,2,opt,name=status,proto3" json:"status" db:"status" validate:"required"`                                      // @gotags: json:"status" db:"status" validate:"required"`
	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,5,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at" db:"expired_at"`                               // @gotags: json:"expired_at" db:"expired_at"
	Email       string                 `protobuf:"bytes,6,opt,name=email,proto3" json:"email" db:"email" validate:"required,email"`                                   // @gotags: json:"email" db:"email" validate:"required,email"`
	Password    string                 `protobuf:"bytes,7,opt,name=password,proto3" json:"password" db:"password" validate:"required"`                                // @gotags: json:"password" db:"password" validate:"required"`
	SigninId    string                 `protobuf:"bytes,8,opt,name=signin_id,json=signinId,proto3" json:"signin_id" db:"signin_id" validate:"required,uuid4_rfc4122"` // @gotags: json:"signin_id" db:"signin_id" validate:"required,uuid4_rfc4122"`
	// contains filtered or unexported fields
}

func (*AccountUpdateParams) Descriptor deprecated

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

Deprecated: Use AccountUpdateParams.ProtoReflect.Descriptor instead.

func (*AccountUpdateParams) GetEmail

func (x *AccountUpdateParams) GetEmail() string

func (*AccountUpdateParams) GetExpiredAt

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

func (*AccountUpdateParams) GetPassword

func (x *AccountUpdateParams) GetPassword() string

func (*AccountUpdateParams) GetPeopleId

func (x *AccountUpdateParams) GetPeopleId() string

func (*AccountUpdateParams) GetSigninId

func (x *AccountUpdateParams) GetSigninId() string

func (*AccountUpdateParams) GetStatus

func (x *AccountUpdateParams) GetStatus() string

func (*AccountUpdateParams) GetValidatedAt

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

func (*AccountUpdateParams) ProtoMessage

func (*AccountUpdateParams) ProtoMessage()

func (*AccountUpdateParams) ProtoReflect

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

func (*AccountUpdateParams) Reset

func (x *AccountUpdateParams) Reset()

func (*AccountUpdateParams) String

func (x *AccountUpdateParams) String() string

type Account_ListClient

type Account_ListClient interface {
	Recv() (*AccountResponse, error)
	grpc.ClientStream
}

type Account_ListServer

type Account_ListServer interface {
	Send(*AccountResponse) error
	grpc.ServerStream
}

type UnimplementedAccountServer

type UnimplementedAccountServer struct {
}

UnimplementedAccountServer must be embedded to have forward compatible implementations.

func (UnimplementedAccountServer) Create

func (UnimplementedAccountServer) Delete

func (UnimplementedAccountServer) Get

func (UnimplementedAccountServer) List

func (UnimplementedAccountServer) Update

type UnsafeAccountServer

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

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

Jump to

Keyboard shortcuts

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