model

package
v0.0.0-...-54bb499 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DB_NAME           = "MicroServicePractice"
	VESSEL_COLLECTION = "vessels"
)

Variables

This section is empty.

Functions

func PBVessel2Vessel

func PBVessel2Vessel(vessel *pb.Vessel) dao.Vessel

func Vessel2PBVessel

func Vessel2PBVessel(vessel *dao.Vessel) pb.Vessel

Types

type Repository

type Repository interface {
	FindAvailable(*pb.Specification) (*pb.Vessel, error)
	Create(*pb.Vessel) error
	Close()
}

type VesselRepository

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

func GetVesselRepository

func GetVesselRepository(session *mgo.Session) *VesselRepository

func (*VesselRepository) Close

func (repo *VesselRepository) Close()

func (*VesselRepository) Create

func (repo *VesselRepository) Create(vessel *pb.Vessel) error

func (*VesselRepository) FindAvailable

func (repo *VesselRepository) FindAvailable(spec *pb.Specification) (*pb.Vessel, error)

接口实现

Jump to

Keyboard shortcuts

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