proto

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package proto defines the interfaces and route registrations generated from IDL files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRouter

func RegisterRouter(mux *http.ServeMux, c Controller, wrap func(next http.Handler) http.Handler)

RegisterRouter registers the HTTP routes for the Controller interface. It maps each method to its corresponding HTTP endpoint, and applies the given middleware (wrap) to each handler.

Types

type Book

type Book struct {
	Title       string `json:"title"`
	Author      string `json:"author"`
	ISBN        string `json:"isbn"`
	Publisher   string `json:"publisher"`
	Price       string `json:"price"`
	RefreshTime string `json:"refreshTime"`
}

Book represents the structure of a book entity.

type Controller

type Controller interface {
	ListBooks(w http.ResponseWriter, r *http.Request)
	GetBook(w http.ResponseWriter, r *http.Request)
	SaveBook(w http.ResponseWriter, r *http.Request)
	DeleteBook(w http.ResponseWriter, r *http.Request)
}

Controller defines the service interface for book-related operations.

Jump to

Keyboard shortcuts

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