database

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 4 Imported by: 0

README

golang-mysql-network-connector

golang-mysql-network-connector は Go ランタイムで MySQL に対し、ネットワーク接続を行うためのライブラリです。

動作環境

動作には以下の環境であることを前提とします。

  • OS: Linux OS
  • CPU: ARM/AMD/Intel
  • Golang Runtime

導入方法

go get でインストールしてください。

go get "github.com/latonaio/golang-mysql-network-connector"

使用方法

MySQL 接続のためのインスタンス作成
db, err := database.NewMySQL(c.DB)
if err != nil {
  l.Error(err)
  return
}
DB の切断処理
defer db.Close()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mysql

type Mysql struct {
	*sql.DB
	// contains filtered or unexported fields
}

func NewMySQL

func NewMySQL(d SetupData) (*Mysql, error)

func (*Mysql) Close

func (d *Mysql) Close()

type SetupData

type SetupData interface {
	DSN() string
}

Jump to

Keyboard shortcuts

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