dao

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PGErrMsgNoRowsFound      = "pg: no rows in result set"
	PGErrMsgNoMultiRowsFound = "pg: multiple rows in result set"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Member

type Member struct {
	ID             string    `json:"id"`
	Email          string    `json:"email" binding:"required,email"`
	PasswordDigest string    `json:"-"`
	Name           string    `json:"name" binding:"required"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`
	DeletedAt      time.Time `pg:",soft_delete" json:"deletedAt"`
}

type MemberDAO

type MemberDAO interface {
	Create(member Member) (string, *util.BusinessError)
	Get(memberID string) (Member, *util.BusinessError)
	Update(member Member) *util.BusinessError
	Delete(memberID string) *util.BusinessError
}

type PGMemberDAO

type PGMemberDAO struct {
	// contains filtered or unexported fields
}

func NewPGMemberDAO

func NewPGMemberDAO(client *pg.DB) *PGMemberDAO

func (*PGMemberDAO) Create

func (p *PGMemberDAO) Create(member Member) (string, *util.BusinessError)

func (*PGMemberDAO) Delete

func (p *PGMemberDAO) Delete(memberID string) *util.BusinessError

func (*PGMemberDAO) Get

func (p *PGMemberDAO) Get(memberID string) (Member, *util.BusinessError)

func (*PGMemberDAO) Update

func (p *PGMemberDAO) Update(member Member) *util.BusinessError

Jump to

Keyboard shortcuts

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