application

package
v0.0.0-...-ca24b28 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const WorkerCount = 10

Variables

This section is empty.

Functions

func VerifyCertificatesIgnoreHostname

func VerifyCertificatesIgnoreHostname(rawCerts [][]byte, caCertPool *x509.CertPool) error

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func New

func New(env Environment, dbp *DBProvider) Application

func (Application) Crash

func (a Application) Crash()

This is a hack to get the logs output to the loggregator before the process exits

func (Application) Run

func (a Application) Run()

func (Application) StartKeyRefresher

func (a Application) StartKeyRefresher(validator *uaa.TokenValidator)

func (Application) StartMessageGC

func (a Application) StartMessageGC()

func (Application) StartQueueGauge

func (a Application) StartQueueGauge()

func (Application) StartServer

func (a Application) StartServer(logger lager.Logger, validator *uaa.TokenValidator)

func (Application) StartWorkers

func (a Application) StartWorkers(validator *uaa.TokenValidator)

func (Application) VerifySMTPConfiguration

func (a Application) VerifySMTPConfiguration()

type DBProvider

type DBProvider struct {
	// contains filtered or unexported fields
}

func NewDBProvider

func NewDBProvider(env Environment) *DBProvider

func (*DBProvider) Database

func (d *DBProvider) Database() db.DatabaseInterface

func (*DBProvider) GobbleDatabase

func (d *DBProvider) GobbleDatabase() gobble.DatabaseInterface

func (*DBProvider) MessagesRepo

func (d *DBProvider) MessagesRepo() v1models.MessagesRepo

func (*DBProvider) Queue

func (d *DBProvider) Queue() gobble.QueueInterface

type Environment

type Environment struct {
	CCHost                             string `env:"CC_HOST" env-required:"true"`
	CORSOrigin                         string `env:"CORS_ORIGIN" env-default:"*"`
	DBLoggingEnabled                   bool   `env:"DB_LOGGING_ENABLED"`
	DBMaxOpenConns                     int    `env:"DB_MAX_OPEN_CONNS"`
	DatabaseURL                        string `env:"DATABASE_URL" env-required:"true"`
	DefaultUAAScopesList               string `env:"DEFAULT_UAA_SCOPES"`
	Domain                             string `env:"DOMAIN" env-required:"true"`
	EncryptionKey                      []byte `env:"ENCRYPTION_KEY" env-required:"true"`
	GobbleWaitMaxDuration              int    `env:"GOBBLE_WAIT_MAX_DURATION" env-default:"5000"`
	GobbleMaxQueueLength               int    `env:"GOBBLE_MAX_QUEUE_LENGTH" env-default:"5000"`
	MaxRetries                         int    `env:"MAX_RETRIES" env-default:"5"`
	Port                               int    `env:"PORT" env-default:"3000"`
	RootPath                           string `env:"ROOT_PATH"`
	SMTPAuthMechanism                  string `env:"SMTP_AUTH_MECHANISM" env-required:"true"`
	SMTPCRAMMD5Secret                  string `env:"SMTP_CRAMMD5_SECRET"`
	SMTPHost                           string `env:"SMTP_HOST" env-required:"true"`
	SMTPLoggingEnabled                 bool   `env:"SMTP_LOGGING_ENABLED" env-default:"false"`
	SMTPPass                           string `env:"SMTP_PASS"`
	SMTPPort                           string `env:"SMTP_PORT" env-required:"true"`
	SMTPTLS                            bool   `env:"SMTP_TLS" env-default:"true"`
	SMTPUser                           string `env:"SMTP_USER"`
	Sender                             string `env:"SENDER" env-required:"true"`
	TestMode                           bool   `env:"TEST_MODE" env-default:"false"`
	UAAClientID                        string `env:"UAA_CLIENT_ID" env-required:"true"`
	UAAClientSecret                    string `env:"UAA_CLIENT_SECRET" env-required:"true"`
	UAAHost                            string `env:"UAA_HOST" env-required:"true"`
	UAAKeyRefreshInterval              int    `env:"UAA_KEY_REFRESH_INTREVAL" env-default:"60000"`
	VerifySSL                          bool   `env:"VERIFY_SSL" env-default:"true"`
	DatabaseCACertFile                 string `env:"DATABASE_CA_CERT_FILE"`
	DatabaseCommonName                 string `env:"DATABASE_COMMON_NAME"`
	DatabaseEnableIdentityVerification bool   `env:"DATABASE_ENABLE_IDENTITY_VERIFICATION" env-default:"true"`

	VCAPApplication struct {
		InstanceIndex int `json:"instance_index"`
	} `env:"VCAP_APPLICATION" env-required:"true"`

	ModelMigrationsPath  string
	GobbleMigrationsPath string
	DefaultUAAScopes     []string
}

func NewEnvironment

func NewEnvironment() (Environment, error)

type EnvironmentError

type EnvironmentError struct {
	Err error
}

func (EnvironmentError) Error

func (e EnvironmentError) Error() string

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func NewMigrator

func NewMigrator(provider persistenceProvider, dbMigrator dbMigrator, shouldMigrate bool, migrationsPath, gobbleMigrationsPath, defaultTemplatePath string) Migrator

func (Migrator) Migrate

func (m Migrator) Migrate()

Jump to

Keyboard shortcuts

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