command

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppFileCommand = &cli.Command{
	Name:    "config",
	Aliases: []string{"c"},
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "output",
			Aliases: []string{"o"},
			Value:   "application.yml",
		},
	},
	Action: func(c *cli.Context) error {
		filename := c.String("output")
		example := config.Config{
			Logging: config.Logging{
				Level: "debug or info or warn or warning(warn) or error or err(error) or critical or dev(debug) or prod(info)",
			},
			Port:              8080,
			SslCertificate:    "ssl/sever.crt",
			SslCertificateKey: "ssl/sever.key",
			Servers: []*config.Servers{
				{
					ServerName: "virtual sever name",
					Login:      "/oauth2/login",
					Callback:   "/oauth2/callback",
					Logout:     "/oauth2/logout",
					Logging: config.Logging{
						Level: "debug or info or warn or warning(warn) or error or err(error) or critical or dev(debug) or prod(info)",
					},
					Oidc: config.Oidc{
						Scopes:       []string{"email", "openid", "offline_access", "profile"},
						Provider:     "https://keycloak/",
						ClientId:     "xxx",
						ClientSecret: "xxx",
						Logout:       "https://keycloak/logout?returnTo=http://localhost:8080/oauth2/login",
						RedirectUrl:  "http://localhost:8080/oauth2/callback",
					},
					Locations: []config.Locations{
						{
							ProxyPass: "http://localhost",
							Urls: []config.Urls{
								{
									Path:  "/",
									Token: "id_token",
								},
							},
						},
					},
					Session: config.Session{
						Name:   "memory",
						Codecs: []string{},
						Args: map[string]interface{}{
							"endpoints": []string{""},
							"username":  "",
							"password":  "",
							"ttl":       30,
						},
					},
				},
			},
		}
		return example.Output(filename)
	},
}
View Source
var ProxyCommand = &cli.Command{
	Name:  "run",
	Usage: "proxy serverの起動を行います。",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    appConf,
			Aliases: []string{"c"},
			Usage:   "application file path",
			Value:   "application.yaml",
		},
	},
	Action: func(c *cli.Context) error {
		return ProxyAction(c.String(appConf))
	},
}

ProxyCommand プロキシサーバーを起動するコマンドです。

Functions

func AppConfig

func AppConfig(applicationFilePath string) (*watch.Watch, error)

AppConfig アプリケーションの設定ファイルを読み込みます。

func CertConfig

func CertConfig(certificate, certificateKey string) (*watch.Watch, error)

func ProxyAction

func ProxyAction(configFilename string) error

ProxyAction プロキシサーバーの実行を行います。

Types

This section is empty.

Jump to

Keyboard shortcuts

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