Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectToDatabase ¶
func ConnectToDatabase(c *Connection, dbType string) (*sql.DB, error)
ConnectToDatabase connects to a database using the provided Connection info and database type.
Types ¶
type Connection ¶
type Connection struct { Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` Name string `json:"database"` Type _sql.DbType `json:"databaseType"` Path string `json:"path"` }
Connection represents a database connection info.
func (*Connection) MarshalJSON ¶
func (c *Connection) MarshalJSON() ([]byte, error)
MarshalJSON customizes the JSON marshaling for the Connection type.
func (*Connection) UnmarshalJSON ¶
func (c *Connection) UnmarshalJSON(data []byte) error
UnmarshalJSON customizes the JSON unmarshaling for the Connection type.
Click to show internal directories.
Click to hide internal directories.