當前位置: 首頁>>代碼示例>>Golang>>正文


Golang ConnectionParams.UnixSocket方法代碼示例

本文整理匯總了Golang中github.com/youtube/vitess/go/mysql.ConnectionParams.UnixSocket方法的典型用法代碼示例。如果您正苦於以下問題:Golang ConnectionParams.UnixSocket方法的具體用法?Golang ConnectionParams.UnixSocket怎麽用?Golang ConnectionParams.UnixSocket使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/youtube/vitess/go/mysql.ConnectionParams的用法示例。


在下文中一共展示了ConnectionParams.UnixSocket方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: InitConnectionParams

// InitConnectionParams may overwrite the socket file,
// and refresh the password to check that works.
func InitConnectionParams(cp *mysql.ConnectionParams, socketFile string) error {
	if socketFile != "" {
		cp.UnixSocket = socketFile
	}
	params := *cp
	return refreshPassword(&params)
}
開發者ID:nimishzynga,項目名稱:vitess,代碼行數:9,代碼來源:dbconfigs.go

示例2: NewMysqld

func NewMysqld(config *Mycnf, dba, repl *mysql.ConnectionParams) *Mysqld {
	if *dba == dbconfigs.DefaultDBConfigs.Dba {
		dba.UnixSocket = config.SocketFile
	}

	return &Mysqld{config,
		dba,
		repl,
		TabletDir(config.ServerId),
		SnapshotDir(config.ServerId),
	}
}
開發者ID:qinbo,項目名稱:vitess,代碼行數:12,代碼來源:mysqld.go

示例3: NewMysqld

// NewMysqld creates a Mysqld object based on the provided configuration
// and connection parameters.
// name is the base for stats exports, use 'Dba', except in tests
func NewMysqld(name string, config *Mycnf, dba, repl *mysql.ConnectionParams) *Mysqld {
	if *dba == dbconfigs.DefaultDBConfigs.Dba {
		dba.UnixSocket = config.SocketFile
	}

	// create and open the connection pool for dba access
	mysqlStats := stats.NewTimings("Mysql" + name)
	dbaPool := dbconnpool.NewConnectionPool(name+"ConnPool", *dbaPoolSize, *dbaIdleTimeout)
	dbaPool.Open(dbconnpool.DBConnectionCreator(dba, mysqlStats))

	return &Mysqld{
		config:      config,
		dba:         dba,
		dbaPool:     dbaPool,
		replParams:  repl,
		TabletDir:   TabletDir(config.ServerId),
		SnapshotDir: SnapshotDir(config.ServerId),
	}
}
開發者ID:miffa,項目名稱:vitess,代碼行數:22,代碼來源:mysqld.go

示例4: NewMysqld

func NewMysqld(config *Mycnf, dba, repl mysql.ConnectionParams) *Mysqld {
	if dba == DefaultDbaParams {
		dba.UnixSocket = config.SocketFile
	}

	// the super connection is not linked to a specific database
	// (allows us to create them)
	superParams := dba
	superParams.DbName = ""
	createSuperConnection := func() (*mysql.Connection, error) {
		return mysql.Connect(superParams)
	}
	return &Mysqld{config,
		dba,
		repl,
		createSuperConnection,
		TabletDir(config.ServerId),
		SnapshotDir(config.ServerId),
	}
}
開發者ID:rjammala,項目名稱:vitess,代碼行數:20,代碼來源:mysqld.go


注:本文中的github.com/youtube/vitess/go/mysql.ConnectionParams.UnixSocket方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。