api

command
v0.3.11-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

README

NHN-ROR-API

Webapi made with Golang and Gin webapi framework

Prerequisites

Get started

Bash commands is from <repo root>/src/backend/ror-api/

Download dependencies:

go get ./...

Start webapi

go run main.go

Or Start the Debug ROR-Api debugger config from VS Code

Generate swagger docs:

Foreach endpoint function, you must add comments for it to show in generated openapi spec

ex:


// @Summary 	Create cluster
// @Schemes
// @Description Create a cluster
// @Tags 		cluster
// @Accept 		application/json
// @Produce 	application/json
// @Success 	200 {object} responses.ClusterResponse
// @Failure 	403  {string}  Forbidden
// @Failure 	401  {string}  Unauthorized
// @Failure 	500  {string}  Failure message
// @Router		/v1/cluster [post]
// @Security	ApiKey || AccessToken
func Create() gin.HandlerFunc {
	return func(c *gin.Context) {
		...
	}
}

Examples of annotations

To generate new swagger you need to install a cmd called swag (https://github.com/swaggo/swag):

go install github.com/swaggo/swag/cmd/swag@latest

(and remember to set <userprofile>\go\bin in PATH to terminal)

And run this command from ror-api root:

 swag init -g cmd/api/main.go --parseDependency --output cmd/api/docs

the folder docs and docs\swagger.json and docs\swagger.yaml is updated/created

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
controllers
acl
The acl controller package provides controller functions for the /acl endpoints in the api V1.
The acl controller package provides controller functions for the /acl endpoints in the api V1.
auditlogs
TODO: Describe package
TODO: Describe package
clusters
The clusters controller package provides controller functions for the /cluster and /clusters endpoints in the api V1.
The clusters controller package provides controller functions for the /cluster and /clusters endpoints in the api V1.
datacenters
TODO: Describe package
TODO: Describe package
desired_version
TODO: Describe package
TODO: Describe package
health
TODO: Describe package
TODO: Describe package
m2m
m2m/configurationcontroller
TODO: Describe package
TODO: Describe package
m2m/token
TODO: Describe package
TODO: Describe package
metrics
TODO: Describe package
TODO: Describe package
operatorconfigs
TODO: Describe package
TODO: Describe package
prices
TODO: Describe package
TODO: Describe package
resourcescontroller
resourcecontroller implements all controllers for resources
resourcecontroller implements all controllers for resources
v2/resourcescontroller
resourcecontroller implements all controllers for resources
resourcecontroller implements all controllers for resources
databases
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
rabbitmq
clustersService
Package clustersservice cluster package provides services to get and manipulate the cluster object
Package clustersservice cluster package provides services to get and manipulate the cluster object
resourcesService
the resource service package provides services to get and manipulate resources
the resource service package provides services to get and manipulate resources
sse

Jump to

Keyboard shortcuts

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