cloudcommon

package
v2.3.20181123+incompat... Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: Apache-2.0 Imports: 17 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB()

func InitApp

func InitApp(options *Options) *appsrv.Application

func InitAuth

func InitAuth(options *Options, authComplete auth.AuthCompletedCallback)

func InitDB

func InitDB(options *DBOptions)

func ParseOptions

func ParseOptions(optStruct interface{}, optionsRef *Options, args []string, configFileName string)

func ServeForever

func ServeForever(app *appsrv.Application, options *Options)

Types

type DBOptions

type DBOptions struct {
	SqlConnection string `help:"SQL connection string"`
	AutoSyncTable bool   `help:"Automatically synchronize table changes if differences are detected"`

	GlobalVirtualResourceNamespace bool `help:"Per project namespace or global namespace for virtual resources"`
	DebugSqlchemy                  bool `default:"False" help:"Print SQL executed by sqlchemy"`

	Options
}

func (*DBOptions) GetDBConnection

func (this *DBOptions) GetDBConnection() (dialect, connstr string, err error)

type Options

type Options struct {
	Port    int    `help:"The port that the service runs on"`
	Address string `help:"The IP address to serve on (set to 0.0.0.0 for all interfaces)" default:"0.0.0.0"`

	LogLevel        string `help:"log level" default:"info" choices:"debug|info|warn|error"`
	LogVerboseLevel int    `help:"log verbosity level" default:"0"`

	Region             string   `help:"Region name or ID"`
	AuthURL            string   `help:"Keystone auth URL" alias:"auth-uri"`
	AdminUser          string   `help:"Admin username"`
	AdminDomain        string   `help:"Admin user domain"`
	AdminPassword      string   `help:"Admin password"`
	AdminProject       string   `help:"Admin project" default:"system" alias:"admin-tenant-name"`
	CorsHosts          []string `help:"List of hostname that allow CORS"`
	AuthTokenCacheSize uint32   `help:"Auth token Cache Size" default:"2048"`
	TempPath           string   `help:"Path for store temp file, at least 40G space" default:"/opt/yunion/tmp"`

	DebugClient bool `help:"Switch on/off mcclient debugs" default:"false"`

	ApplicationID      string `help:"Application ID"`
	RequestWorkerCount int    `default:"4" help:"Request worker thread count, default is 4"`

	NotifyAdminUser string `default:"sysadmin" help:"System administrator user ID or name to notify"`

	EnableSsl   bool   `help:"Enable https"`
	SslCertfile string `help:"ssl certification file"`
	SslKeyfile  string `help:"ssl certification key file"`

	EnableRbac                       bool `help:"Switch on Role-based Access Control" default:"true"`
	RbacDebug                        bool `help:"turn on rbac debug log" default:"false"`
	RbacPolicySyncPeriodSeconds      int  `help:"policy sync interval in seconds, default 15 minutes" default:"900"`
	RbacPolicySyncFailedRetrySeconds int  `help:"seconds to wait after a failed sync, default 30 seconds" default:"30"`

	structarg.BaseOptions
}

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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