config

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DEPLOY_MODE_CLOUD = "cloud"
View Source
const DEPLOY_MODE_SELF_HOST = "self-host"
View Source
const DRIVE_TYPE_AWS = "aws"
View Source
const DRIVE_TYPE_MINIO = "minio"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// server config
	ServerHost         string `env:"ILLA_SERVER_HOST"              envDefault:"0.0.0.0"`
	ServerPort         string `env:"ILLA_SERVER_PORT"              envDefault:"8003"`
	InternalServerPort string `env:"ILLA_SERVER_INTERNAL_PORT"     envDefault:"9001"`
	ServerMode         string `env:"ILLA_SERVER_MODE"              envDefault:"debug"`
	DeployMode         string `env:"ILLA_DEPLOY_MODE"              envDefault:"self-host"`
	ServeHTTPS         string `env:"ILLA_DEPLOY_SERVE_HTTPS"       envDefault:"false"`

	// storage config
	PostgresAddr     string `env:"ILLA_SUPERVISOR_PG_ADDR" envDefault:"localhost"`
	PostgresPort     string `env:"ILLA_SUPERVISOR_PG_PORT" envDefault:"5432"`
	PostgresUser     string `env:"ILLA_SUPERVISOR_PG_USER" envDefault:"illa_supervisor"`
	PostgresPassword string `env:"ILLA_SUPERVISOR_PG_PASSWORD" envDefault:"illa2022"`
	PostgresDatabase string `env:"ILLA_SUPERVISOR_PG_DATABASE" envDefault:"illa_supervisor"`
	// cache config
	RedisAddr     string `env:"ILLA_REDIS_ADDR" envDefault:"localhost"`
	RedisPort     string `env:"ILLA_REDIS_PORT" envDefault:"6379"`
	RedisPassword string `env:"ILLA_REDIS_PASSWORD" envDefault:""`
	RedisDatabase int    `env:"ILLA_REDIS_DATABASE" envDefault:"0"`

	// drive config
	DriveType             string `env:"ILLA_DRIVE_TYPE"               envDefault:""`
	DriveAccessKeyID      string `env:"ILLA_DRIVE_ACCESS_KEY_ID"      envDefault:"minioadmin"`
	DriveAccessKeySecret  string `env:"ILLA_DRIVE_ACCESS_KEY_SECRET"  envDefault:"minioadmin"`
	DriveRegion           string `env:"ILLA_DRIVE_REGION"             envDefault:""`
	DriveEndpoint         string `env:"ILLA_DRIVE_ENDPOINT"           envDefault:"127.0.0.1:9000"`
	DriveSystemBucketName string `env:"ILLA_DRIVE_SYSTEM_BUCKET_NAME" envDefault:"illa-supervisor"`
	DriveTeamBucketName   string `env:"ILLA_DRIVE_TEAM_BUCKET_NAME"   envDefault:"illa-supervisor-team"`
	DriveUploadTimeoutRaw string `env:"ILLA_DRIVE_UPLOAD_TIMEOUT"     envDefault:"300s"`
	DriveUploadTimeout    time.Duration
}

func GetConfig

func GetConfig() (*Config, error)

func (*Config) GetAWSS3AccessKeyID

func (c *Config) GetAWSS3AccessKeyID() string

func (*Config) GetAWSS3AccessKeySecret

func (c *Config) GetAWSS3AccessKeySecret() string

func (*Config) GetAWSS3Region

func (c *Config) GetAWSS3Region() string

func (*Config) GetAWSS3SystemBucketName

func (c *Config) GetAWSS3SystemBucketName() string

func (*Config) GetAWSS3TeamBucketName

func (c *Config) GetAWSS3TeamBucketName() string

func (*Config) GetAWSS3Timeout

func (c *Config) GetAWSS3Timeout() time.Duration

func (*Config) GetDriveType

func (c *Config) GetDriveType() string

func (*Config) GetMINIOAccessKeyID

func (c *Config) GetMINIOAccessKeyID() string

func (*Config) GetMINIOAccessKeySecret

func (c *Config) GetMINIOAccessKeySecret() string

func (*Config) GetMINIOEndpoint

func (c *Config) GetMINIOEndpoint() string

func (*Config) GetMINIOSystemBucketName

func (c *Config) GetMINIOSystemBucketName() string

func (*Config) GetMINIOTeamBucketName

func (c *Config) GetMINIOTeamBucketName() string

func (*Config) GetMINIOTimeout

func (c *Config) GetMINIOTimeout() time.Duration

func (*Config) GetPostgresAddr added in v0.0.8

func (c *Config) GetPostgresAddr() string

func (*Config) GetPostgresDatabase added in v0.0.8

func (c *Config) GetPostgresDatabase() string

func (*Config) GetPostgresPassword added in v0.0.8

func (c *Config) GetPostgresPassword() string

func (*Config) GetPostgresPort added in v0.0.8

func (c *Config) GetPostgresPort() string

func (*Config) GetPostgresUser added in v0.0.8

func (c *Config) GetPostgresUser() string

func (*Config) GetRedisAddr added in v0.0.8

func (c *Config) GetRedisAddr() string

func (*Config) GetRedisDatabase added in v0.0.8

func (c *Config) GetRedisDatabase() int

func (*Config) GetRedisPassword added in v0.0.8

func (c *Config) GetRedisPassword() string

func (*Config) GetRedisPort added in v0.0.8

func (c *Config) GetRedisPort() string

func (*Config) GetServeHTTPAddress

func (c *Config) GetServeHTTPAddress() string

func (*Config) IsAWSDrive

func (c *Config) IsAWSDrive() bool

func (*Config) IsCloudMode

func (c *Config) IsCloudMode() bool

func (*Config) IsMINIODrive

func (c *Config) IsMINIODrive() bool

func (*Config) IsSelfHostMode

func (c *Config) IsSelfHostMode() bool

func (*Config) IsServeHTTPS

func (c *Config) IsServeHTTPS() bool

Jump to

Keyboard shortcuts

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