示例#1
0
func NewDBService(dbURL string) (*DBService, error) {
	db, err := db.Connect(dbURL)
	if err != nil {
		return nil, err
	}

	return &DBService{db, false}, nil
}
示例#2
0
func NewService(dbURL string) (*Service, error) {
	db, err := db.Connect(dbURL)
	if err != nil {
		return nil, err
	}

	return &Service{db}, nil
}