testv1connect

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContentServiceIndexProcedure is the fully-qualified name of the ContentService's Index RPC.
	ContentServiceIndexProcedure = "/vanguard.test.v1.ContentService/Index"
	// ContentServiceUploadProcedure is the fully-qualified name of the ContentService's Upload RPC.
	ContentServiceUploadProcedure = "/vanguard.test.v1.ContentService/Upload"
	// ContentServiceDownloadProcedure is the fully-qualified name of the ContentService's Download RPC.
	ContentServiceDownloadProcedure = "/vanguard.test.v1.ContentService/Download"
	// ContentServiceSubscribeProcedure is the fully-qualified name of the ContentService's Subscribe
	// RPC.
	ContentServiceSubscribeProcedure = "/vanguard.test.v1.ContentService/Subscribe"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// LibraryServiceGetBookProcedure is the fully-qualified name of the LibraryService's GetBook RPC.
	LibraryServiceGetBookProcedure = "/vanguard.test.v1.LibraryService/GetBook"
	// LibraryServiceCreateBookProcedure is the fully-qualified name of the LibraryService's CreateBook
	// RPC.
	LibraryServiceCreateBookProcedure = "/vanguard.test.v1.LibraryService/CreateBook"
	// LibraryServiceListBooksProcedure is the fully-qualified name of the LibraryService's ListBooks
	// RPC.
	LibraryServiceListBooksProcedure = "/vanguard.test.v1.LibraryService/ListBooks"
	// LibraryServiceCreateShelfProcedure is the fully-qualified name of the LibraryService's
	// CreateShelf RPC.
	LibraryServiceCreateShelfProcedure = "/vanguard.test.v1.LibraryService/CreateShelf"
	// LibraryServiceUpdateBookProcedure is the fully-qualified name of the LibraryService's UpdateBook
	// RPC.
	LibraryServiceUpdateBookProcedure = "/vanguard.test.v1.LibraryService/UpdateBook"
	// LibraryServiceDeleteBookProcedure is the fully-qualified name of the LibraryService's DeleteBook
	// RPC.
	LibraryServiceDeleteBookProcedure = "/vanguard.test.v1.LibraryService/DeleteBook"
	// LibraryServiceSearchBooksProcedure is the fully-qualified name of the LibraryService's
	// SearchBooks RPC.
	LibraryServiceSearchBooksProcedure = "/vanguard.test.v1.LibraryService/SearchBooks"
	// LibraryServiceMoveBooksProcedure is the fully-qualified name of the LibraryService's MoveBooks
	// RPC.
	LibraryServiceMoveBooksProcedure = "/vanguard.test.v1.LibraryService/MoveBooks"
	// LibraryServiceCheckoutBooksProcedure is the fully-qualified name of the LibraryService's
	// CheckoutBooks RPC.
	LibraryServiceCheckoutBooksProcedure = "/vanguard.test.v1.LibraryService/CheckoutBooks"
	// LibraryServiceReturnBooksProcedure is the fully-qualified name of the LibraryService's
	// ReturnBooks RPC.
	LibraryServiceReturnBooksProcedure = "/vanguard.test.v1.LibraryService/ReturnBooks"
	// LibraryServiceGetCheckoutProcedure is the fully-qualified name of the LibraryService's
	// GetCheckout RPC.
	LibraryServiceGetCheckoutProcedure = "/vanguard.test.v1.LibraryService/GetCheckout"
	// LibraryServiceListCheckoutsProcedure is the fully-qualified name of the LibraryService's
	// ListCheckouts RPC.
	LibraryServiceListCheckoutsProcedure = "/vanguard.test.v1.LibraryService/ListCheckouts"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// ContentServiceName is the fully-qualified name of the ContentService service.
	ContentServiceName = "vanguard.test.v1.ContentService"
)
View Source
const (
	// LibraryServiceName is the fully-qualified name of the LibraryService service.
	LibraryServiceName = "vanguard.test.v1.LibraryService"
)

Variables

This section is empty.

Functions

func NewContentServiceHandler

func NewContentServiceHandler(svc ContentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewContentServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewLibraryServiceHandler

func NewLibraryServiceHandler(svc LibraryServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewLibraryServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type ContentServiceClient

type ContentServiceClient interface {
	// Index returns a html index page at the given path.
	Index(context.Context, *connect.Request[v1.IndexRequest]) (*connect.Response[httpbody.HttpBody], error)
	// Upload a file to the given path.
	Upload(context.Context) *connect.ClientStreamForClient[v1.UploadRequest, emptypb.Empty]
	// Download a file from the given path.
	Download(context.Context, *connect.Request[v1.DownloadRequest]) (*connect.ServerStreamForClient[v1.DownloadResponse], error)
	// Subscribe to updates for changes to content.
	Subscribe(context.Context) *connect.BidiStreamForClient[v1.SubscribeRequest, v1.SubscribeResponse]
}

ContentServiceClient is a client for the vanguard.test.v1.ContentService service.

func NewContentServiceClient

func NewContentServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ContentServiceClient

NewContentServiceClient constructs a client for the vanguard.test.v1.ContentService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type ContentServiceHandler

type ContentServiceHandler interface {
	// Index returns a html index page at the given path.
	Index(context.Context, *connect.Request[v1.IndexRequest]) (*connect.Response[httpbody.HttpBody], error)
	// Upload a file to the given path.
	Upload(context.Context, *connect.ClientStream[v1.UploadRequest]) (*connect.Response[emptypb.Empty], error)
	// Download a file from the given path.
	Download(context.Context, *connect.Request[v1.DownloadRequest], *connect.ServerStream[v1.DownloadResponse]) error
	// Subscribe to updates for changes to content.
	Subscribe(context.Context, *connect.BidiStream[v1.SubscribeRequest, v1.SubscribeResponse]) error
}

ContentServiceHandler is an implementation of the vanguard.test.v1.ContentService service.

type LibraryServiceClient

type LibraryServiceClient interface {
	// Gets a book.
	GetBook(context.Context, *connect.Request[v1.GetBookRequest]) (*connect.Response[v1.Book], error)
	// Creates a book, and returns the new Book.
	CreateBook(context.Context, *connect.Request[v1.CreateBookRequest]) (*connect.Response[v1.Book], error)
	// Lists books in a shelf.
	ListBooks(context.Context, *connect.Request[v1.ListBooksRequest]) (*connect.Response[v1.ListBooksResponse], error)
	// Creates a shelf.
	CreateShelf(context.Context, *connect.Request[v1.CreateShelfRequest]) (*connect.Response[v1.Shelf], error)
	// Updates a book.
	UpdateBook(context.Context, *connect.Request[v1.UpdateBookRequest]) (*connect.Response[v1.Book], error)
	// Deletes a book.
	DeleteBook(context.Context, *connect.Request[v1.DeleteBookRequest]) (*connect.Response[emptypb.Empty], error)
	// Search books in a shelf.
	SearchBooks(context.Context, *connect.Request[v1.SearchBooksRequest]) (*connect.Response[v1.SearchBooksResponse], error)
	MoveBooks(context.Context, *connect.Request[v1.MoveBooksRequest]) (*connect.Response[v1.MoveBooksResponse], error)
	CheckoutBooks(context.Context, *connect.Request[v1.CheckoutBooksRequest]) (*connect.Response[v1.Checkout], error)
	ReturnBooks(context.Context, *connect.Request[v1.ReturnBooksRequest]) (*connect.Response[emptypb.Empty], error)
	GetCheckout(context.Context, *connect.Request[v1.GetCheckoutRequest]) (*connect.Response[v1.Checkout], error)
	ListCheckouts(context.Context, *connect.Request[v1.ListCheckoutsRequest]) (*connect.Response[v1.ListCheckoutsResponse], error)
}

LibraryServiceClient is a client for the vanguard.test.v1.LibraryService service.

func NewLibraryServiceClient

func NewLibraryServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) LibraryServiceClient

NewLibraryServiceClient constructs a client for the vanguard.test.v1.LibraryService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type LibraryServiceHandler

type LibraryServiceHandler interface {
	// Gets a book.
	GetBook(context.Context, *connect.Request[v1.GetBookRequest]) (*connect.Response[v1.Book], error)
	// Creates a book, and returns the new Book.
	CreateBook(context.Context, *connect.Request[v1.CreateBookRequest]) (*connect.Response[v1.Book], error)
	// Lists books in a shelf.
	ListBooks(context.Context, *connect.Request[v1.ListBooksRequest]) (*connect.Response[v1.ListBooksResponse], error)
	// Creates a shelf.
	CreateShelf(context.Context, *connect.Request[v1.CreateShelfRequest]) (*connect.Response[v1.Shelf], error)
	// Updates a book.
	UpdateBook(context.Context, *connect.Request[v1.UpdateBookRequest]) (*connect.Response[v1.Book], error)
	// Deletes a book.
	DeleteBook(context.Context, *connect.Request[v1.DeleteBookRequest]) (*connect.Response[emptypb.Empty], error)
	// Search books in a shelf.
	SearchBooks(context.Context, *connect.Request[v1.SearchBooksRequest]) (*connect.Response[v1.SearchBooksResponse], error)
	MoveBooks(context.Context, *connect.Request[v1.MoveBooksRequest]) (*connect.Response[v1.MoveBooksResponse], error)
	CheckoutBooks(context.Context, *connect.Request[v1.CheckoutBooksRequest]) (*connect.Response[v1.Checkout], error)
	ReturnBooks(context.Context, *connect.Request[v1.ReturnBooksRequest]) (*connect.Response[emptypb.Empty], error)
	GetCheckout(context.Context, *connect.Request[v1.GetCheckoutRequest]) (*connect.Response[v1.Checkout], error)
	ListCheckouts(context.Context, *connect.Request[v1.ListCheckoutsRequest]) (*connect.Response[v1.ListCheckoutsResponse], error)
}

LibraryServiceHandler is an implementation of the vanguard.test.v1.LibraryService service.

type UnimplementedContentServiceHandler

type UnimplementedContentServiceHandler struct{}

UnimplementedContentServiceHandler returns CodeUnimplemented from all methods.

type UnimplementedLibraryServiceHandler

type UnimplementedLibraryServiceHandler struct{}

UnimplementedLibraryServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedLibraryServiceHandler) CheckoutBooks

func (UnimplementedLibraryServiceHandler) CreateBook

func (UnimplementedLibraryServiceHandler) CreateShelf

func (UnimplementedLibraryServiceHandler) DeleteBook

func (UnimplementedLibraryServiceHandler) GetBook

func (UnimplementedLibraryServiceHandler) GetCheckout

func (UnimplementedLibraryServiceHandler) ReturnBooks

func (UnimplementedLibraryServiceHandler) UpdateBook

Jump to

Keyboard shortcuts

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