models

package
v0.0.0-...-f8e6c8b Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	ID   uint64
	Name string
}

type DataRepo

type DataRepo interface {
	Save(Data) error
	Get(uint64) (Data, error)
	List(uint64) ([]Data, error)
}

func NewMySQLDataRepo

func NewMySQLDataRepo(cfg *mysql.Config) (DataRepo, error)

type MySQLDataRepo

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

func (*MySQLDataRepo) Close

func (s *MySQLDataRepo) Close() error

func (*MySQLDataRepo) Get

func (s *MySQLDataRepo) Get(id uint64) (Data, error)

func (*MySQLDataRepo) List

func (s *MySQLDataRepo) List(limit uint64) ([]Data, error)

func (*MySQLDataRepo) Save

func (s *MySQLDataRepo) Save(data Data) error

Jump to

Keyboard shortcuts

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