basic

command
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 5 Imported by: 0

README

Basic Example

This is the CalculatorService example from the main README. It's just an opportunity to see all the code required. The only change to this version is that the handler shows some basic error handling.

To run this example, just execute the following commands from this directory. You can look at the makefile to see what commands it's running under the hood... it's fairly simple.

# In terminal 1
make calculator-service

# In terminal 2
make run

If everything is working properly, you should see the output:

5 + 2 = 7
5 - 2 = 3

What This Example Shows

  • The basic pattern for writing idiomatic services and their functions.
  • How to run your service through frodo to generate your API and client.
  • How to use your Frodo-generated artifacts to run and consume your service.
  • You can get a working API without requiring any special configurations.
  • How to generate 4XX status error codes using the rpc/errors package.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gen
Code generated by Frodo - DO NOT EDIT.
Code generated by Frodo - DO NOT EDIT.

Jump to

Keyboard shortcuts

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