config

package
v0.0.0-...-9e48597 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DEPLOY_MODE_CLOUD = "cloud"
View Source
const DEPLOY_MODE_CLOUD_BETA = "cloud-beta"
View Source
const DEPLOY_MODE_CLOUD_PRODUCTION = "cloud-production"
View Source
const DEPLOY_MODE_CLOUD_TEST = "cloud-test"
View Source
const DEPLOY_MODE_SELF_HOST = "self-host"
View Source
const DRIVE_TYPE_AWS = "aws"
View Source
const DRIVE_TYPE_DO = "do"
View Source
const DRIVE_TYPE_MINIO = "minio"
View Source
const PROTOCOL_WEBSOCKET = "ws"
View Source
const PROTOCOL_WEBSOCKET_OVER_TLS = "wss"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// server config
	ServerHost         string `env:"KOZMO_SERVER_HOST" envDefault:"0.0.0.0"`
	ServerPort         string `env:"KOZMO_SERVER_PORT" envDefault:"8001"`
	InternalServerPort string `env:"KOZMO_SERVER_INTERNAL_PORT" envDefault:"9005"`
	ServerMode         string `env:"KOZMO_SERVER_MODE" envDefault:"debug"`
	DeployMode         string `env:"KOZMO_DEPLOY_MODE" envDefault:"self-host"`
	SecretKey          string `env:"KOZMO_SECRET_KEY" envDefault:"8xEMrWkBARcDDYQ"`

	// websocket config
	WebsocketServerHost                       string `env:"KOZMO_WEBSOCKET_SERVER_HOST" envDefault:"0.0.0.0"`
	WebsocketServerPort                       string `env:"KOZMO_WEBSOCKET_SERVER_PORT" envDefault:"8002"`
	WebsocketServerConnectionHost             string `env:"KOZMO_WEBSOCKET_CONNECTION_HOST" envDefault:"0.0.0.0"`
	WebsocketServerConnectionPort             string `env:"KOZMO_WEBSOCKET_CONNECTION_PORT" envDefault:"80"`
	WebsocketServerConnectionHostSouthAsia    string `env:"KOZMO_WEBSOCKET_CONNECTION_HOST_SOUTH_ASIA" envDefault:"0.0.0.0"`
	WebsocketServerConnectionPortSouthAsia    string `env:"KOZMO_WEBSOCKET_CONNECTION_PORT_SOUTH_ASIA" envDefault:"80"`
	WebsocketServerConnectionHostEastAsia     string `env:"KOZMO_WEBSOCKET_CONNECTION_HOST_EAST_ASIA" envDefault:"0.0.0.0"`
	WebsocketServerConnectionPortEastAsia     string `env:"KOZMO_WEBSOCKET_CONNECTION_PORT_EAST_ASIA" envDefault:"80"`
	WebsocketServerConnectionHostCenterEurope string `env:"KOZMO_WEBSOCKET_CONNECTION_HOST_CENTER_EUROPE" envDefault:"0.0.0.0"`
	WebsocketServerConnectionPortCenterEurope string `env:"KOZMO_WEBSOCKET_CONNECTION_PORT_CENTER_EUROPE" envDefault:"80"`
	WSSEnabled                                string `env:"KOZMO_WSS_ENABLED" envDefault:"false"`

	// key for idconvertor
	RandomKey string `env:"KOZMO_RANDOM_KEY"  envDefault:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"`
	// storage config
	PostgresAddr     string `env:"KOZMO_PG_ADDR" envDefault:"localhost"`
	PostgresPort     string `env:"KOZMO_PG_PORT" envDefault:"5432"`
	PostgresUser     string `env:"KOZMO_PG_USER" envDefault:"kozmo_builder"`
	PostgresPassword string `env:"KOZMO_PG_PASSWORD" envDefault:"71De5JllWSetLYU"`
	PostgresDatabase string `env:"KOZMO_PG_DATABASE" envDefault:"kozmo_builder"`
	// cache config
	RedisAddr     string `env:"KOZMO_REDIS_ADDR" envDefault:"localhost"`
	RedisPort     string `env:"KOZMO_REDIS_PORT" envDefault:"6379"`
	RedisPassword string `env:"KOZMO_REDIS_PASSWORD" envDefault:"kozmo2022"`
	RedisDatabase int    `env:"KOZMO_REDIS_DATABASE" envDefault:"0"`
	// drive config
	DriveType             string `env:"KOZMO_DRIVE_TYPE" envDefault:""`
	DriveAccessKeyID      string `env:"KOZMO_DRIVE_ACCESS_KEY_ID" envDefault:""`
	DriveAccessKeySecret  string `env:"KOZMO_DRIVE_ACCESS_KEY_SECRET" envDefault:""`
	DriveRegion           string `env:"KOZMO_DRIVE_REGION" envDefault:""`
	DriveEndpoint         string `env:"KOZMO_DRIVE_ENDPOINT" envDefault:""`
	DriveSystemBucketName string `env:"KOZMO_DRIVE_SYSTEM_BUCKET_NAME" envDefault:"kozmo-cloud"`
	DriveTeamBucketName   string `env:"KOZMO_DRIVE_TEAM_BUCKET_NAME" envDefault:"kozmo-cloud-team"`
	DriveUploadTimeoutRaw string `env:"KOZMO_DRIVE_UPLOAD_TIMEOUT" envDefault:"30s"`
	DriveUploadTimeout    time.Duration
	// supervisor API
	KozmoSupervisorInternalRestAPI string `env:"KOZMO_SUPERVISOR_INTERNAL_API" envDefault:"http://127.0.0.1:9001/api/v1"`

	// peripheral API
	KozmoPeripheralAPI string `env:"KOZMO_PERIPHERAL_API" envDefault:"https://peripheral-api.kozmoai.com/v1/"`

	// kozmo marketplace config
	KozmoMarketplaceInternalRestAPI string `env:"KOZMO_MARKETPLACE_INTERNAL_API" envDefault:"http://kozmo-marketplace-backend-internal:9003/api/v1"`
	// token for internal api
	ControlToken string `env:"KOZMO_CONTROL_TOKEN" envDefault:""`
	// google config
	KozmoGoogleSheetsClientID     string `env:"KOZMO_GS_CLIENT_ID" envDefault:""`
	KozmoGoogleSheetsClientSecret string `env:"KOZMO_GS_CLIENT_SECRET" envDefault:""`
	KozmoGoogleSheetsRedirectURI  string `env:"KOZMO_GS_REDIRECT_URI" envDefault:""`
	// toke for ip zone detector
	KozmoIPZoneDetectorToken string `env:"KOZMO_IP_ZONE_DETECTOR_TOKEN" envDefault:""`
	// kozmo drive config
	KozmoDriveRestAPI string `env:"KOZMO_DRIVE_API" envDefault:"http://kozmo-drive-backend:8004"`
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *Config

func (*Config) GetAWSS3AccessKeyID

func (c *Config) GetAWSS3AccessKeyID() string

func (*Config) GetAWSS3AccessKeySecret

func (c *Config) GetAWSS3AccessKeySecret() string

func (*Config) GetAWSS3Endpoint

func (c *Config) GetAWSS3Endpoint() 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) GetControlToken

func (c *Config) GetControlToken() string

func (*Config) GetDriveType

func (c *Config) GetDriveType() string

func (*Config) GetIPZoneDetectorToken

func (c *Config) GetIPZoneDetectorToken() string

func (*Config) GetKozmoDriveAPIForSDK

func (c *Config) GetKozmoDriveAPIForSDK() string

func (*Config) GetKozmoGoogleSheetsClientID

func (c *Config) GetKozmoGoogleSheetsClientID() string

func (*Config) GetKozmoGoogleSheetsClientSecret

func (c *Config) GetKozmoGoogleSheetsClientSecret() string

func (*Config) GetKozmoGoogleSheetsRedirectURI

func (c *Config) GetKozmoGoogleSheetsRedirectURI() string

func (*Config) GetKozmoMarketplaceInternalRestAPI

func (c *Config) GetKozmoMarketplaceInternalRestAPI() string

func (*Config) GetKozmoPeripheralAPI

func (c *Config) GetKozmoPeripheralAPI() string

func (*Config) GetKozmoSupervisorInternalRestAPI

func (c *Config) GetKozmoSupervisorInternalRestAPI() 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

func (c *Config) GetPostgresAddr() string

func (*Config) GetPostgresDatabase

func (c *Config) GetPostgresDatabase() string

func (*Config) GetPostgresPassword

func (c *Config) GetPostgresPassword() string

func (*Config) GetPostgresPort

func (c *Config) GetPostgresPort() string

func (*Config) GetPostgresUser

func (c *Config) GetPostgresUser() string

func (*Config) GetRandomKey

func (c *Config) GetRandomKey() string

func (*Config) GetRedisAddr

func (c *Config) GetRedisAddr() string

func (*Config) GetRedisDatabase

func (c *Config) GetRedisDatabase() int

func (*Config) GetRedisPassword

func (c *Config) GetRedisPassword() string

func (*Config) GetRedisPort

func (c *Config) GetRedisPort() string

func (*Config) GetRuntimeEnv

func (c *Config) GetRuntimeEnv() string

func (*Config) GetSecretKey

func (c *Config) GetSecretKey() string

func (*Config) GetWebScoketServerConnectionAddress

func (c *Config) GetWebScoketServerConnectionAddress() string

func (*Config) GetWebScoketServerConnectionAddressCenterEurope

func (c *Config) GetWebScoketServerConnectionAddressCenterEurope() string

func (*Config) GetWebScoketServerConnectionAddressEastAsia

func (c *Config) GetWebScoketServerConnectionAddressEastAsia() string

func (*Config) GetWebScoketServerConnectionAddressSouthAsia

func (c *Config) GetWebScoketServerConnectionAddressSouthAsia() string

func (*Config) GetWebScoketServerListenAddress

func (c *Config) GetWebScoketServerListenAddress() string

func (*Config) GetWebsocketProtocol

func (c *Config) GetWebsocketProtocol() string

func (*Config) GetkozmoResourceManagerInternalRestAPI

func (c *Config) GetkozmoResourceManagerInternalRestAPI() string

func (*Config) GetkozmoResourceManagerRestAPI

func (c *Config) GetkozmoResourceManagerRestAPI() string

func (*Config) IsAWSTypeDrive

func (c *Config) IsAWSTypeDrive() bool

func (*Config) IsCloudBetaMode

func (c *Config) IsCloudBetaMode() bool

func (*Config) IsCloudMode

func (c *Config) IsCloudMode() bool

func (*Config) IsCloudProductionMode

func (c *Config) IsCloudProductionMode() bool

func (*Config) IsCloudTestMode

func (c *Config) IsCloudTestMode() bool

func (*Config) IsMINIODrive

func (c *Config) IsMINIODrive() bool

func (*Config) IsSelfHostMode

func (c *Config) IsSelfHostMode() bool

Jump to

Keyboard shortcuts

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