Documentation ¶
Overview ¶
Package authorsv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterAuthorsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthorsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthorsServiceClient) error
- func RegisterAuthorsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthorsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthorsServiceServer) error
- func RegisterAuthorsServiceServer(s grpc.ServiceRegistrar, srv AuthorsServiceServer)
- type Author
- type Authors
- type AuthorsServiceClient
- type AuthorsServiceServer
- type ReadAuthorRequest
- type UnimplementedAuthorsServiceServer
- func (UnimplementedAuthorsServiceServer) CreateAuthor(context.Context, *Author) (*Author, error)
- func (UnimplementedAuthorsServiceServer) ReadAuthor(context.Context, *ReadAuthorRequest) (*Author, error)
- func (UnimplementedAuthorsServiceServer) ReadAuthors(context.Context, *VoidNoParam) (*Authors, error)
- type UnsafeAuthorsServiceServer
- type VoidNoParam
Constants ¶
const ( AuthorsService_ReadAuthors_FullMethodName = "/authors.v1.AuthorsService/readAuthors" AuthorsService_CreateAuthor_FullMethodName = "/authors.v1.AuthorsService/createAuthor" AuthorsService_ReadAuthor_FullMethodName = "/authors.v1.AuthorsService/readAuthor" )
Variables ¶
var AuthorsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "authors.v1.AuthorsService", HandlerType: (*AuthorsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "readAuthors", Handler: _AuthorsService_ReadAuthors_Handler, }, { MethodName: "createAuthor", Handler: _AuthorsService_CreateAuthor_Handler, }, { MethodName: "readAuthor", Handler: _AuthorsService_ReadAuthor_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "authors/v1/authors.proto", }
AuthorsService_ServiceDesc is the grpc.ServiceDesc for AuthorsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterAuthorsServiceHandler ¶
func RegisterAuthorsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAuthorsServiceHandler registers the http handlers for service AuthorsService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthorsServiceHandlerClient ¶
func RegisterAuthorsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthorsServiceClient) error
RegisterAuthorsServiceHandlerClient registers the http handlers for service AuthorsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthorsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthorsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthorsServiceClient" to call the correct interceptors.
func RegisterAuthorsServiceHandlerFromEndpoint ¶
func RegisterAuthorsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthorsServiceHandlerFromEndpoint is same as RegisterAuthorsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthorsServiceHandlerServer ¶
func RegisterAuthorsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthorsServiceServer) error
RegisterAuthorsServiceHandlerServer registers the http handlers for service AuthorsService to "mux". UnaryRPC :call AuthorsServiceServer 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 RegisterAuthorsServiceHandlerFromEndpoint instead.
func RegisterAuthorsServiceServer ¶
func RegisterAuthorsServiceServer(s grpc.ServiceRegistrar, srv AuthorsServiceServer)
Types ¶
type Author ¶
type Author struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` Bio string `protobuf:"bytes,3,opt,name=Bio,proto3" json:"Bio,omitempty"` // contains filtered or unexported fields }
func (*Author) Descriptor
deprecated
func (*Author) ProtoMessage ¶
func (*Author) ProtoMessage()
func (*Author) ProtoReflect ¶
func (x *Author) ProtoReflect() protoreflect.Message
type Authors ¶
type Authors struct { Author []*Author `protobuf:"bytes,1,rep,name=author,proto3" json:"author,omitempty"` // contains filtered or unexported fields }
func (*Authors) Descriptor
deprecated
func (*Authors) ProtoMessage ¶
func (*Authors) ProtoMessage()
func (*Authors) ProtoReflect ¶
func (x *Authors) ProtoReflect() protoreflect.Message
type AuthorsServiceClient ¶
type AuthorsServiceClient interface { ReadAuthors(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (*Authors, error) CreateAuthor(ctx context.Context, in *Author, opts ...grpc.CallOption) (*Author, error) ReadAuthor(ctx context.Context, in *ReadAuthorRequest, opts ...grpc.CallOption) (*Author, error) }
AuthorsServiceClient is the client API for AuthorsService 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 NewAuthorsServiceClient ¶
func NewAuthorsServiceClient(cc grpc.ClientConnInterface) AuthorsServiceClient
type AuthorsServiceServer ¶
type AuthorsServiceServer interface { ReadAuthors(context.Context, *VoidNoParam) (*Authors, error) CreateAuthor(context.Context, *Author) (*Author, error) ReadAuthor(context.Context, *ReadAuthorRequest) (*Author, error) // contains filtered or unexported methods }
AuthorsServiceServer is the server API for AuthorsService service. All implementations must embed UnimplementedAuthorsServiceServer for forward compatibility
type ReadAuthorRequest ¶
type ReadAuthorRequest struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // contains filtered or unexported fields }
func (*ReadAuthorRequest) Descriptor
deprecated
func (*ReadAuthorRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadAuthorRequest.ProtoReflect.Descriptor instead.
func (*ReadAuthorRequest) GetID ¶
func (x *ReadAuthorRequest) GetID() int64
func (*ReadAuthorRequest) ProtoMessage ¶
func (*ReadAuthorRequest) ProtoMessage()
func (*ReadAuthorRequest) ProtoReflect ¶
func (x *ReadAuthorRequest) ProtoReflect() protoreflect.Message
func (*ReadAuthorRequest) Reset ¶
func (x *ReadAuthorRequest) Reset()
func (*ReadAuthorRequest) String ¶
func (x *ReadAuthorRequest) String() string
type UnimplementedAuthorsServiceServer ¶
type UnimplementedAuthorsServiceServer struct { }
UnimplementedAuthorsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthorsServiceServer) CreateAuthor ¶
func (UnimplementedAuthorsServiceServer) ReadAuthor ¶
func (UnimplementedAuthorsServiceServer) ReadAuthor(context.Context, *ReadAuthorRequest) (*Author, error)
func (UnimplementedAuthorsServiceServer) ReadAuthors ¶
func (UnimplementedAuthorsServiceServer) ReadAuthors(context.Context, *VoidNoParam) (*Authors, error)
type UnsafeAuthorsServiceServer ¶
type UnsafeAuthorsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuthorsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthorsServiceServer will result in compilation errors.
type VoidNoParam ¶
type VoidNoParam struct {
// contains filtered or unexported fields
}
func (*VoidNoParam) Descriptor
deprecated
func (*VoidNoParam) Descriptor() ([]byte, []int)
Deprecated: Use VoidNoParam.ProtoReflect.Descriptor instead.
func (*VoidNoParam) ProtoMessage ¶
func (*VoidNoParam) ProtoMessage()
func (*VoidNoParam) ProtoReflect ¶
func (x *VoidNoParam) ProtoReflect() protoreflect.Message
func (*VoidNoParam) Reset ¶
func (x *VoidNoParam) Reset()
func (*VoidNoParam) String ¶
func (x *VoidNoParam) String() string