Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MicroserviceInfo ¶
type MicroserviceInfo struct {
ServiceName string `json:"service_name"`
ServiceType string `json:"service_type"`
ServiceScope string `json:"service_scope"`
ServiceVersion string `json:"service_version"`
Endpoints []Route `json:"endpoints"`
}
MicroserviceInfo - Represents information about this microservice.
func GetMicroserviceInfo ¶
func GetMicroserviceInfo() *MicroserviceInfo
GetMicroserviceInfo - Get the information about this microservice.
Return:
*MicroserviceInfo - Object representing this microservice.
Example ¶
ExampleGetMicroserviceInfo - Example for GetMicroserviceInfo.
envVars := map[string]string{
"SERVICE_NAME": "example-service",
"SERVICE_TYPE": "examples",
"SERVICE_SCOPE": "testing",
"SERVICE_VERSION": "0.0.1",
}
// Set our expected environment variables.
for key, value := range envVars {
os.Setenv(key, value)
}
// Get the service info.
info := GetMicroserviceInfo()
// Print the details.
fmt.Println(info.ServiceName)
fmt.Println(info.ServiceType)
fmt.Println(info.ServiceScope)
fmt.Println(info.ServiceVersion)
Output: example-service examples testing 0.0.1
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pagination defines a paginator able to return formatted responses enabling the API consumer to retrieve data in defined chunks
|
Package pagination defines a paginator able to return formatted responses enabling the API consumer to retrieve data in defined chunks |
|
Package response defines the how the default microservice response must look and behave like.
|
Package response defines the how the default microservice response must look and behave like. |
Click to show internal directories.
Click to hide internal directories.