db

package
v0.0.0-...-21fa723 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DriverName string
	ConnInfo   string

	TableName string
}

Config DBconn config

type DBconn

type DBconn struct {
	DriverName string
	ConnInfo   string

	TableName string
	// contains filtered or unexported fields
}

DBconn db 연결정보

func New

func New(cfg Config) (*DBconn, error)

New 새로운 db connection 생성

func (*DBconn) Delete

func (conn *DBconn) Delete(param Item) (int64, error)

Delete entry 삭제

func (*DBconn) Destroy

func (conn *DBconn) Destroy() error

Destroy db connection 해제

func (*DBconn) Get

func (conn *DBconn) Get(param Item) (interface{}, interface{}, error)

Get entry 반환

func (*DBconn) Insert

func (conn *DBconn) Insert(item Item) error

Insert entry 삽입

type Item

type Item struct {
	Subject     string    `json:"subject"`
	Category    string    `json:"category"`
	OrgFilename string    `json:"orgfilename"`
	Filename    string    `json:"filename"`
	FileFormat  string    `json:"-"`
	FilePath    string    `json:"-"`
	CreateAt    time.Time `json:"createAt"`
}

Item 데이터 항목

type NullTime

type NullTime struct {
	sql.NullTime
}

func (*NullTime) MarshalJSON

func (nt *NullTime) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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