package
0.3.0
Repository: https://github.com/hack-31/point-app-backend.git
Documentation: pkg.go.dev

# README

リポジトリ層

  • データストア(データベース)とドメインの橋かけを担う
  • DB操作にまつわる操作(SQL)などは必ずリポジトリに記述する
  • データの永続化と再構築を行う

ファイル

transaction.go

  • トランザクションを扱うコード
// 利用方法
// router.go, auth_router.goでインスタンス化 
appConnection := repository.NewAppConnection(db)
// サービスに渡して利用
sendPointHandler := handler.NewSendPoint(&service.SendPoint{PointRepo: &rep, UserRepo: &rep, Connection: appConnection, DB: db})

error.go

  • エラーを定義する

kvs.go

  • Key/Values
  • Redisにアクセスするための構造体

repository.go

  • DBのインスタンス作成やIFを定義

# Packages

No description provided by the author
Package entities contains generated code for schema 'point_app'.

# Functions

DBへの接続 @params ctx コンテキスト cfg 接続設定の環境変数 @return *sqlx.DB DBインスタンス, func() DBクローズ関数(予備先素でdeferで呼ぶ必要あり).
No description provided by the author
No description provided by the author

# Constants

ErrCodeMySQLDuplicateEntry はMySQL系のDUPLICATEエラーコード https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html Error number: 1062; Symbol: ER_DUP_ENTRY; SQLSTATE: 23000.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

トランザクションメソッド系類.
書き込み系メソッド類.
比較系メソッド類.
読み取り系メソッド類.

# Type aliases

No description provided by the author