private/apigen: Document Endpoint fields

Add document comments to tall the fields of the Endpoint struct.

Change-Id: Ibcd534f26474fc73fb378a9f30ce7d9401217557
This commit is contained in:
Ivan Fraixedes 2023-09-23 18:40:30 +02:00
parent d67bb4f2c5
commit 822a13570e
No known key found for this signature in database
GPG Key ID: FB6101AFB5CB5AD5

View File

@ -10,16 +10,32 @@ import (
// Endpoint represents endpoint's configuration.
type Endpoint struct {
Name string
Description string
MethodName string
// Name is a free text used to name the endpoint for documentation purpose.
// It cannot be empty.
Name string
// Description is a free text to describe the endpoint for documentation purpose.
Description string
// MethodName is the name of method of the service interface which handles the business logic of
// this endpoint.
// It must fulfill the Go language specification for method names
// (https://go.dev/ref/spec#MethodName)
// TODO: Should we rename this field to be something like ServiceMethodName?
MethodName string
// RequestName is the name of the method used to name the method in the client side code. When not
// set, MethodName is used.
// TODO: Should we delete this field in favor of always using MethodName?
RequestName string
NoCookieAuth bool
NoAPIAuth bool
Request interface{}
Response interface{}
QueryParams []Param
PathParams []Param
// Request is the type that defines the format of the request body.
Request interface{}
// Response is the type that defines the format of the response body.
Response interface{}
// QueryParams is the list of query parameters that the endpoint accepts.
QueryParams []Param
// PathParams is the list of path parameters that appear in the path associated with this
// endpoint.
PathParams []Param
}
// CookieAuth returns endpoint's cookie auth status.