Documentation ¶
Overview ¶
Package api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterUsersHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error
- func RegisterUsersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUsersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServer) error
- func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer)
- type Login
- type Login_Request
- type Login_Response
- type UnimplementedUsersServer
- type UnsafeUsersServer
- type UsersClient
- type UsersServer
Constants ¶
const (
Users_Login_FullMethodName = "/api.Users/Login"
)
Variables ¶
var File_pkg_api_users_proto protoreflect.FileDescriptor
var SwaggerJson []byte
var Users_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.Users", HandlerType: (*UsersServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _Users_Login_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/api/users.proto", }
Users_ServiceDesc is the grpc.ServiceDesc for Users service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUsersHandler ¶
RegisterUsersHandler registers the http handlers for service Users to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUsersHandlerClient ¶
func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error
RegisterUsersHandlerClient registers the http handlers for service Users to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UsersClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterUsersHandlerFromEndpoint ¶
func RegisterUsersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUsersHandlerFromEndpoint is same as RegisterUsersHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUsersHandlerServer ¶
func RegisterUsersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServer) error
RegisterUsersHandlerServer registers the http handlers for service Users to "mux". UnaryRPC :call UsersServer 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 RegisterUsersHandlerFromEndpoint 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 RegisterUsersServer ¶
func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer)
Types ¶
type Login ¶
type Login struct {
// contains filtered or unexported fields
}
func (*Login) Descriptor
deprecated
func (*Login) ProtoMessage ¶
func (*Login) ProtoMessage()
func (*Login) ProtoReflect ¶
func (x *Login) ProtoReflect() protoreflect.Message
type Login_Request ¶
type Login_Request struct { AppleJwt string `protobuf:"bytes,1,opt,name=apple_jwt,json=appleJwt,proto3" json:"apple_jwt,omitempty"` // contains filtered or unexported fields }
func (*Login_Request) Descriptor
deprecated
func (*Login_Request) Descriptor() ([]byte, []int)
Deprecated: Use Login_Request.ProtoReflect.Descriptor instead.
func (*Login_Request) GetAppleJwt ¶
func (x *Login_Request) GetAppleJwt() string
func (*Login_Request) ProtoMessage ¶
func (*Login_Request) ProtoMessage()
func (*Login_Request) ProtoReflect ¶
func (x *Login_Request) ProtoReflect() protoreflect.Message
func (*Login_Request) Reset ¶
func (x *Login_Request) Reset()
func (*Login_Request) String ¶
func (x *Login_Request) String() string
type Login_Response ¶
type Login_Response struct { Bearer string `protobuf:"bytes,1,opt,name=bearer,proto3" json:"bearer,omitempty"` // contains filtered or unexported fields }
func (*Login_Response) Descriptor
deprecated
func (*Login_Response) Descriptor() ([]byte, []int)
Deprecated: Use Login_Response.ProtoReflect.Descriptor instead.
func (*Login_Response) GetBearer ¶
func (x *Login_Response) GetBearer() string
func (*Login_Response) ProtoMessage ¶
func (*Login_Response) ProtoMessage()
func (*Login_Response) ProtoReflect ¶
func (x *Login_Response) ProtoReflect() protoreflect.Message
func (*Login_Response) Reset ¶
func (x *Login_Response) Reset()
func (*Login_Response) String ¶
func (x *Login_Response) String() string
type UnimplementedUsersServer ¶
type UnimplementedUsersServer struct { }
UnimplementedUsersServer must be embedded to have forward compatible implementations.
func (UnimplementedUsersServer) Login ¶
func (UnimplementedUsersServer) Login(context.Context, *Login_Request) (*Login_Response, error)
type UnsafeUsersServer ¶
type UnsafeUsersServer interface {
// contains filtered or unexported methods
}
UnsafeUsersServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UsersServer will result in compilation errors.
type UsersClient ¶
type UsersClient interface {
Login(ctx context.Context, in *Login_Request, opts ...grpc.CallOption) (*Login_Response, error)
}
UsersClient is the client API for Users 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 NewUsersClient ¶
func NewUsersClient(cc grpc.ClientConnInterface) UsersClient
type UsersServer ¶
type UsersServer interface { Login(context.Context, *Login_Request) (*Login_Response, error) // contains filtered or unexported methods }
UsersServer is the server API for Users service. All implementations must embed UnimplementedUsersServer for forward compatibility