MCPcopy Create free account
hub / github.com/cloudbase/garm / ConnectionString

Method ConnectionString

config/config.go:634–645  ·  view source on GitHub ↗

ConnectionString returns a gorm compatible connection string

()

Source from the content-addressed store, hash-verified

632
633// ConnectionString returns a gorm compatible connection string
634func (m *MySQL) ConnectionString() (string, error) {
635 if err := m.Validate(); err != nil {
636 return "", err
637 }
638
639 connString := fmt.Sprintf(
640 "%s:%s@tcp(%s)/%s?charset=utf8&parseTime=True&loc=Local&timeout=5s",
641 m.Username, m.Password,
642 m.Hostname, m.DatabaseName,
643 )
644 return connString, nil
645}
646
647// TLSConfig is the API server TLS config
648type TLSConfig struct {

Callers 1

GormParamsMethod · 0.45

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected