config

package
v0.0.0-...-467dd59 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(cfg *Config) (*neo4j.DriverWithContext, error)

Types

type Config

type Config struct {
	Postgres struct {
		Host            string `env:"POSTGRES_HOST,required"`
		Port            string `env:"POSTGRES_PORT,required"`
		User            string `env:"POSTGRES_USER,required,unset"`
		Db              string `env:"POSTGRES_DB,required"`
		Password        string `env:"POSTGRES_PASSWORD,required,unset"`
		MaxConn         int    `env:"POSTGRES_DB_MAX_CONN"`
		MaxIdleConn     int    `env:"POSTGRES_DB_MAX_IDLE_CONN"`
		ConnMaxLifetime int    `env:"POSTGRES_DB_CONN_MAX_LIFETIME"`
	}
	Service struct {
		MessageStoreUrl    string `env:"MESSAGE_STORE_URL,required"`
		MessageStoreApiKey string `env:"MESSAGE_STORE_API_KEY,required"`
		ChannelsApi        string `env:"CHANNELS_API_URL,required"`
		CorsUrl            string `env:"CORS_URL,required"`
		ServerAddress      string `env:"OASIS_API_SERVER_ADDRESS,required"`
		GRPCPort           int    `env:"OASIS_GRPC_PORT,required"`
	}
	WebRTC struct {
		AuthSecret   string `env:"WEBRTC_AUTH_SECRET,required"`
		TTL          int    `env:"WEBRTC_AUTH_TTL,required"`
		PingInterval int    `env:"WEBSOCKET_PING_INTERVAL"`
	}
	Neo4j struct {
		Target                string `env:"NEO4J_TARGET,required"`
		User                  string `env:"NEO4J_AUTH_USER,required,unset"`
		Pwd                   string `env:"NEO4J_AUTH_PWD,required,unset"`
		Realm                 string `env:"NEO4J_AUTH_REALM"`
		MaxConnectionPoolSize int    `env:"NEO4J_MAX_CONN_POOL_SIZE" envDefault:"100"`
		LogLevel              string `env:"NEO4J_LOG_LEVEL" envDefault:"WARNING"`
	}
}

type StorageDB

type StorageDB struct {
	SqlDB  *sql.DB
	GormDB *gorm.DB
}

func NewDBConn

func NewDBConn(host, port, name, user, pass string, maxConn, maxIdleConn, connMaxLifetime int) (*StorageDB, error)

Jump to

Keyboard shortcuts

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