authorsv1

package
v0.0.0-...-f062f70 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package authorsv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AuthorsService_ReadAuthors_FullMethodName  = "/authors.v1.AuthorsService/readAuthors"
	AuthorsService_CreateAuthor_FullMethodName = "/authors.v1.AuthorsService/createAuthor"
	AuthorsService_ReadAuthor_FullMethodName   = "/authors.v1.AuthorsService/readAuthor"
)

Variables

View Source
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)

View Source
var File_authors_v1_authors_proto protoreflect.FileDescriptor

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) Descriptor() ([]byte, []int)

Deprecated: Use Author.ProtoReflect.Descriptor instead.

func (*Author) GetBio

func (x *Author) GetBio() string

func (*Author) GetID

func (x *Author) GetID() int64

func (*Author) GetName

func (x *Author) GetName() string

func (*Author) ProtoMessage

func (*Author) ProtoMessage()

func (*Author) ProtoReflect

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

func (*Author) Reset

func (x *Author) Reset()

func (*Author) String

func (x *Author) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Authors.ProtoReflect.Descriptor instead.

func (*Authors) GetAuthor

func (x *Authors) GetAuthor() []*Author

func (*Authors) ProtoMessage

func (*Authors) ProtoMessage()

func (*Authors) ProtoReflect

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

func (*Authors) Reset

func (x *Authors) Reset()

func (*Authors) String

func (x *Authors) String() string

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.

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) ReadAuthors

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

Jump to

Keyboard shortcuts

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