server

package
v0.0.0-...-04ccfb0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// MainListenAddr sets the listen address of the main server
	MainListenAddr string `envconfig:"MAIN_LISTEN_ADDR" default:"0.0.0.0:3000"`
	// ResolverListenAddr sets the listen address of the resolver server
	ResolverListenAddr string `envconfig:"RESOLVER_LISTEN_ADDR" default:"0.0.0.0:3001"`
	// AdminListenAddr sets the listen address of the admin API server
	AdminListenAddr string `envconfig:"ADMIN_LISTEN_ADDR" default:"0.0.0.0:3002"`

	MainInteralListenAddr      string `envconfig:"MAIN_INTERNAL_LISTEN_ADDR" default:"0.0.0.0:13000"`
	ResolverInternalListenAddr string `envconfig:"RESOLVER_INTERNAL_LISTEN_ADDR" default:"0.0.0.0:13001"`
	AdminInternalListenAddr    string `envconfig:"ADMIN_INTERNAL_LISTEN_ADDR" default:"0.0.0.0:13002"`

	// TLSCertFilePath sets the file path of TLS certificate.
	// It is only used when development mode is enabled.
	TLSCertFilePath string `envconfig:"TLS_CERT_FILE_PATH" default:"tls-cert.pem"`
	// TLSKeyFilePath sets the file path of TLS private key.
	// It is only used when development mode is enabled.
	TLSKeyFilePath string `envconfig:"TLS_KEY_FILE_PATH" default:"tls-key.pem"`

	// AdminAPIAuth indicates the authorization mode of Admin API
	AdminAPIAuth config.AdminAPIAuth `envconfig:"ADMIN_API_AUTH" default:"jwt"`
	// ConfigSource configures the source of app configurations
	ConfigSource *configsource.Config `envconfig:"CONFIG_SOURCE"`

	// BuiltinResourceDirectory sets the directory for built-in resource files
	BuiltinResourceDirectory string `envconfig:"BUILTIN_RESOURCE_DIRECTORY" default:"resources/authgear"`
	// CustomResourceDirectory sets the directory for customized resource files
	CustomResourceDirectory string `envconfig:"CUSTOM_RESOURCE_DIRECTORY"`

	*config.EnvironmentConfig
}

func LoadConfigFromEnv

func LoadConfigFromEnv() (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type Controller

type Controller struct {
	ServeMain     bool
	ServeResolver bool
	ServeAdmin    bool
	// contains filtered or unexported fields
}

func (*Controller) Start

func (c *Controller) Start()

Jump to

Keyboard shortcuts

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