repository

package
v0.0.0-...-ac6bbda Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormSession

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

GormSession is a type definition for GormSession

func NewGormSession

func NewGormSession(dbms, connect string) (*GormSession, error)

NewGormSession creates a GormSession

func (*GormSession) Close

func (s *GormSession) Close() error

Close GormSession

func (*GormSession) CreateProduct

func (s *GormSession) CreateProduct(p *entity.Product) error

CreateProduct ...

func (*GormSession) MigrateProduct

func (s *GormSession) MigrateProduct()

MigrateProduct ...

func (*GormSession) ReadProduct

func (s *GormSession) ReadProduct(id string) (*entity.Product, error)

ReadProduct ...

func (*GormSession) ReadProducts

func (s *GormSession) ReadProducts() ([]entity.Product, error)

ReadProducts ...

type MockSession

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

MockSession for test

func NewMockSession

func NewMockSession() (*MockSession, error)

NewMockSession creates a MockSession

func (*MockSession) Close

func (s *MockSession) Close() error

Close ...

func (*MockSession) CreateProduct

func (s *MockSession) CreateProduct(p *entity.Product) error

CreateProduct ...

func (*MockSession) MigrateProduct

func (s *MockSession) MigrateProduct()

MigrateProduct ...

func (*MockSession) ReadProduct

func (s *MockSession) ReadProduct(id string) (*entity.Product, error)

ReadProduct ...

func (*MockSession) ReadProducts

func (s *MockSession) ReadProducts() ([]entity.Product, error)

ReadProducts ...

type Session

type Session interface {
	Close() error
	CreateProduct(p *entity.Product) error
	ReadProduct(id string) (*entity.Product, error)
	ReadProducts() ([]entity.Product, error)
	MigrateProduct()
}

Session ...

Jump to

Keyboard shortcuts

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