api

module
v0.0.0-...-b62a1b2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0

README ΒΆ

API Directory Documentation

Hello there, fellow coders! πŸ™ŒπŸ™ŒπŸ™Œ This document will guide you through the ins and outs of our api directory.

1. The Heart of API Declarations: The API Directory πŸ’–

The api directory is our central hub for API declarations. We use protobuf files to declare APIs, specifying the supported call methods (like HTTP protocols POST, GET, PUT, DELETE, etc.), the call content formats (like application/json, form-data, etc.), and the detailed field names and sizes. Plus, these protobuf files can integrate with third-party syntax for parameter checking, saving us from writing a chunk of parameter validation code. πŸŽ‰πŸŽ‰πŸŽ‰

2. Organization and Versioning πŸ—„

We recommend creating an individual folder for each functional module within the api directory, where you can store its protobuf files. This setup makes it easier to manage different versions of your APIs. πŸš€πŸš€πŸš€

3. Code Generation and Implementation πŸ› 

Once you've got your API details down, you can simply run the make api command to automatically generate Go language code. Then, implement the interface in the service directory, and you're ready to start making calls! πŸ’»πŸ’»πŸ’»

4. Module Management with Go Mod πŸ“¦

We suggest managing your APIs as separate Go Mod modules. This approach can make it easier to provide other microservices with access to your APIs. 🌐🌐🌐

We hope this guide helps you navigate the api directory with ease. Happy coding! 🎈🎈🎈

Directories ΒΆ

Path Synopsis
login
v1

Jump to

Keyboard shortcuts

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