Documentation
¶
Overview ¶
Package me is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterMeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MeClient) error
- func RegisterMeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MeServer) error
- func RegisterMeServer(s grpc.ServiceRegistrar, srv MeServer)
- type MeClient
- type MeServer
- type RegenerateTokenResponse
- func (*RegenerateTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RegenerateTokenResponse) GetToken() string
- func (*RegenerateTokenResponse) ProtoMessage()
- func (x *RegenerateTokenResponse) ProtoReflect() protoreflect.Message
- func (x *RegenerateTokenResponse) Reset()
- func (x *RegenerateTokenResponse) String() string
- type UnimplementedMeServer
- type UnsafeMeServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedAt() *timestamp.Timestamp
- func (x *User) GetEmail() string
- func (x *User) GetHasToken() bool
- func (x *User) GetId() string
- func (x *User) GetOrganizationId() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
Constants ¶
const ( Me_Me_FullMethodName = "/Superplane.Me.Me/Me" Me_RegenerateToken_FullMethodName = "/Superplane.Me.Me/RegenerateToken" )
Variables ¶
var File_me_proto protoreflect.FileDescriptor
var Me_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Superplane.Me.Me", HandlerType: (*MeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Me", Handler: _Me_Me_Handler, }, { MethodName: "RegenerateToken", Handler: _Me_RegenerateToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "me.proto", }
Me_ServiceDesc is the grpc.ServiceDesc for Me service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMeHandler ¶
RegisterMeHandler registers the http handlers for service Me to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMeHandlerClient ¶
RegisterMeHandlerClient registers the http handlers for service Me to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MeClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MeClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MeClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterMeHandlerFromEndpoint ¶
func RegisterMeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMeHandlerFromEndpoint is same as RegisterMeHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMeHandlerServer ¶
RegisterMeHandlerServer registers the http handlers for service Me to "mux". UnaryRPC :call MeServer 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 RegisterMeHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterMeServer ¶
func RegisterMeServer(s grpc.ServiceRegistrar, srv MeServer)
Types ¶
type MeClient ¶
type MeClient interface {
// Endpoint for getting the currently authenticated user.
Me(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*User, error)
// Endpoint for regenerating the currently authenticated user's API token.
RegenerateToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RegenerateTokenResponse, error)
}
MeClient is the client API for Me 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 NewMeClient ¶
func NewMeClient(cc grpc.ClientConnInterface) MeClient
type MeServer ¶
type MeServer interface {
// Endpoint for getting the currently authenticated user.
Me(context.Context, *empty.Empty) (*User, error)
// Endpoint for regenerating the currently authenticated user's API token.
RegenerateToken(context.Context, *empty.Empty) (*RegenerateTokenResponse, error)
}
MeServer is the server API for Me service. All implementations should embed UnimplementedMeServer for forward compatibility.
type RegenerateTokenResponse ¶
type RegenerateTokenResponse struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
// contains filtered or unexported fields
}
func (*RegenerateTokenResponse) Descriptor
deprecated
func (*RegenerateTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use RegenerateTokenResponse.ProtoReflect.Descriptor instead.
func (*RegenerateTokenResponse) GetToken ¶
func (x *RegenerateTokenResponse) GetToken() string
func (*RegenerateTokenResponse) ProtoMessage ¶
func (*RegenerateTokenResponse) ProtoMessage()
func (*RegenerateTokenResponse) ProtoReflect ¶
func (x *RegenerateTokenResponse) ProtoReflect() protoreflect.Message
func (*RegenerateTokenResponse) Reset ¶
func (x *RegenerateTokenResponse) Reset()
func (*RegenerateTokenResponse) String ¶
func (x *RegenerateTokenResponse) String() string
type UnimplementedMeServer ¶
type UnimplementedMeServer struct{}
UnimplementedMeServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMeServer) RegenerateToken ¶
func (UnimplementedMeServer) RegenerateToken(context.Context, *empty.Empty) (*RegenerateTokenResponse, error)
type UnsafeMeServer ¶
type UnsafeMeServer interface {
// contains filtered or unexported methods
}
UnsafeMeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MeServer will result in compilation errors.
type User ¶
type User struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
OrganizationId string `protobuf:"bytes,3,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"`
CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
HasToken bool `protobuf:"varint,5,opt,name=has_token,json=hasToken,proto3" json:"has_token,omitempty"`
// contains filtered or unexported fields
}
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (*User) GetHasToken ¶
func (*User) GetOrganizationId ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message