Add command usage example

This commit is contained in:
Jonas Kaninda
2024-10-30 04:52:49 +01:00
parent 5537292bc6
commit 02dcd4dc75
4 changed files with 10 additions and 5 deletions

View File

@@ -119,7 +119,7 @@ gateway:
readTimeout: 15 readTimeout: 15
# Proxy idle timeout # Proxy idle timeout
idleTimeout: 60 idleTimeout: 60
# Proxy rate limit, it's In-Memory Token Bucket # Proxy rate limit, it's In-Memory IP based
# Distributed Rate Limiting for Token based across multiple instances is not yet integrated # Distributed Rate Limiting for Token based across multiple instances is not yet integrated
rateLimiter: 0 rateLimiter: 0
accessLog: "/dev/Stdout" accessLog: "/dev/Stdout"
@@ -128,6 +128,7 @@ gateway:
disableRouteHealthCheckError: false disableRouteHealthCheckError: false
# Disable display routes on start # Disable display routes on start
disableDisplayRouteOnStart: false disableDisplayRouteOnStart: false
disableKeepAlive: false
# interceptErrors intercepts backend errors based on defined the status codes # interceptErrors intercepts backend errors based on defined the status codes
interceptErrors: interceptErrors:
- 405 - 405
@@ -237,14 +238,14 @@ gateway:
middlewares: middlewares:
# Enable Basic auth authorization based # Enable Basic auth authorization based
- name: local-auth-basic - name: local-auth-basic
# Authentication types | jwtAuth, basicAuth, auth0 # Authentication types | jwt, basic, OAuth
type: basic type: basic
rule: rule:
username: admin username: admin
password: admin password: admin
#Enables JWT authorization based on the result of a request and continues the request. #Enables JWT authorization based on the result of a request and continues the request.
- name: google-auth - name: google-auth
# Authentication types | jwtAuth, basicAuth, OAuth # Authentication types | jwt, basic, OAuth
# jwt authorization based on the result of backend's response and continue the request when the client is authorized # jwt authorization based on the result of backend's response and continue the request when the client is authorized
type: jwt type: jwt
rule: rule:

View File

@@ -23,7 +23,7 @@ import (
var Cmd = &cobra.Command{ var Cmd = &cobra.Command{
Use: "config", Use: "config",
Short: "Goma configuration", Short: "Goma Gateway configuration management",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 { if len(args) == 0 {
return return

View File

@@ -28,7 +28,7 @@ var rootCmd = &cobra.Command{
Use: "goma", Use: "goma",
Short: "Goma Gateway is a lightweight API Gateway, Reverse Proxy", Short: "Goma Gateway is a lightweight API Gateway, Reverse Proxy",
Long: `.`, Long: `.`,
Example: "", Example: util.MainExample,
Version: util.FullVersion(), Version: util.FullVersion(),
} }

View File

@@ -29,3 +29,7 @@ func FullVersion() string {
} }
return ver return ver
} }
const MainExample = "Initialize config: init config --output config.yml\n" +
"Start server: server \n" +
"Start server with custom config file: server --config config.yml"