server

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(
	ctx context.Context,
	logger log.Logger,
	cfg Config,
	nrApp newrelic.Application,
	deps api.Deps,
	dbPromCollector prometheus.Collector,
) error

func ServeUI added in v0.8.17

func ServeUI(ctx context.Context, logger log.Logger, uiConfig UIConfig, apiServerConfig Config)

Types

type Config

type Config struct {
	// port to listen HTTP requests on
	Port int `yaml:"port" mapstructure:"port" default:"8080"`

	// GRPC Config
	GRPC GRPCConfig `mapstructure:"grpc"`

	// metrics port
	MetricsPort int `yaml:"metrics_port" mapstructure:"metrics_port" default:"9000"`

	// the network interface to listen on
	Host string `yaml:"host" mapstructure:"host" default:"127.0.0.1"`

	// TODO might not suitable here because it is also being used by proxy
	// Headers which will have user's email id
	IdentityProxyHeader string `yaml:"identity_proxy_header" mapstructure:"identity_proxy_header" default:""`

	// ResourcesPath is a directory path where resources is defined
	// that this service should implement
	ResourcesConfigPath string `yaml:"resources_config_path" mapstructure:"resources_config_path"`

	// ResourcesPathSecretSecret could be an env name, file path or actual value required
	// to access ResourcesPathSecretPath files
	ResourcesConfigPathSecret string `yaml:"resources_config_path_secret" mapstructure:"resources_config_path_secret"`

	Authentication authenticate.Config `yaml:"authentication" mapstructure:"authentication"`

	// Deprecated: use Cors instead
	CorsOrigin []string `yaml:"cors_origin" mapstructure:"cors_origin"`
	// Cors configuration setup origin value from where we want to allow cors
	// headers and methods are the list of headers and methods we want to allow
	Cors interceptors.CorsConfig `yaml:"cors" mapstructure:"cors"`

	Admin bootstrap.AdminConfig `yaml:"admin" mapstructure:"admin"`

	Mailer mailer.Config `yaml:"mailer" mapstructure:"mailer"`

	Webhook webhook.Config `yaml:"webhook" mapstructure:"webhook"`
}

type GRPCConfig

type GRPCConfig struct {
	Port            int    `mapstructure:"port" default:"8081"`
	MaxRecvMsgSize  int    `mapstructure:"max_recv_msg_size" default:"33554432"`
	MaxSendMsgSize  int    `mapstructure:"max_send_msg_size" default:"33554432"`
	TLSCertFile     string `mapstructure:"tls_cert_file" default:""`
	TLSKeyFile      string `mapstructure:"tls_key_file" default:""`
	TLSClientCAFile string `mapstructure:"tls_client_ca_file" default:""`
}

type UIConfig added in v0.8.17

type UIConfig struct {
	Port int `yaml:"port" mapstructure:"port"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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