Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListExportedMethodNames ¶
Types ¶
type RPC ¶
type RPC struct { *validator.Validate // contains filtered or unexported fields }
func NewRPC ¶
NewRPC builds an RPC with from an instance of a type and its methods.
The exported methods must have the following signature. Where INPUT is a pointer to your input type, and OUTPUT is value your method sends back to the client.
fn(ctx context.Context, in *INPUT) (*OUTPUT, status.Status)
INPUT is validated before being passed to it method. see https://pkg.go.dev/github.com/go-playground/validator/v10
type Foo struct { Email string `validate:"email"` }
Docs endpoints are created for each method.
GET /<type>/help // gets list of methods GET /<type>/<method>/help // gets INPUT/OUTPUT
func (*RPC) MountFiberApp ¶
func (s *RPC) MountFiberApp(app *fiber.App) fiber.Router
func (*RPC) NewNetHttpHandler ¶
func (s *RPC) NewNetHttpHandler() http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.