Documentation ¶
Index ¶
- Constants
- func Consignment2PBConsignment(con *dao.Consignment) pb.Consignment
- func InterfaceToPB(from interface{}, pb interface{}) error
- func JSON2Map(jsonByte []byte) (map[string]interface{}, error)
- func PB2JSON(pb proto.Message) ([]byte, error)
- func PB2Map(pb proto.Message) (map[string]interface{}, error)
- func PBConsignment2Consignment(con *pb.Consignment) dao.Consignment
- type ConsignmentRepository
- type Repository
Constants ¶
View Source
const ( DB_NAME = "MicroServicePractice" CON_COLLECTION = "consignments" )
Variables ¶
This section is empty.
Functions ¶
func Consignment2PBConsignment ¶
func Consignment2PBConsignment(con *dao.Consignment) pb.Consignment
func InterfaceToPB ¶
func InterfaceToPB(from interface{}, pb interface{}) error
func PBConsignment2Consignment ¶
func PBConsignment2Consignment(con *pb.Consignment) dao.Consignment
Types ¶
type ConsignmentRepository ¶
type ConsignmentRepository struct {
// contains filtered or unexported fields
}
func GetConsignmentRepository ¶
func GetConsignmentRepository(session *mgo.Session) *ConsignmentRepository
func (*ConsignmentRepository) Create ¶
func (repo *ConsignmentRepository) Create(con *pb.Consignment) error
接口实现
func (*ConsignmentRepository) GetAll ¶
func (repo *ConsignmentRepository) GetAll() ([]*pb.Consignment, error)
获取全部数据
type Repository ¶
type Repository interface { Create(*pb.Consignment) error GetAll() ([]*pb.Consignment, error) Close() }
Click to show internal directories.
Click to hide internal directories.