Documentation
¶
Overview ¶
Copyright © 2020 Darko Luketic <info@icod.de>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Darko Luketic <info@icod.de>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Darko Luketic <info@icod.de>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Darko Luketic <info@icod.de>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Product
- func DownloadAndParse(url string) ([]*Product, error)
- func FilterByGenre(value string, products []*Product) []*Product
- func FilterByProductGroup(value string, products []*Product) []*Product
- func FilterBySupplier(value string, products []*Product) []*Product
- func FilterByUSK(value string, products []*Product) []*Product
- func Parse(reader io.Reader) ([]*Product, error)
- func ParseFile(path string) ([]*Product, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Product ¶
type Product struct { ProductNumber string `bson:"product_number" json:"product_number"` Title string `bson:"title" json:"title"` EAN string `bson:"ean" json:"ean"` ReleaseDate time.Time `bson:"release_date" json:"release_date"` Supplier string `bson:"supplier" json:"supplier"` ProductGroup string `bson:"product_group" json:"product_group"` Genre string `bson:"genre" json:"genre"` USK string `bson:"usk" json:"usk"` Rating string `bson:"rating" json:"rating"` Price float64 `bson:"price" json:"price"` RecommendedPrice float64 `bson:"recommended_price" json:"recommended_price"` }
func DownloadAndParse ¶
DownloadAndParse is a convenience function that downloads the Preisliste.csv from an URL and returns a slice of *Product
func FilterByGenre ¶
FilterByGenre is a convenience function that filters products by genre
func FilterByProductGroup ¶
FilterByProductGroup is a convenience function that filters products by product group
func FilterBySupplier ¶
FilterBySupplier is a convenience function that filters products by supplier
func FilterByUSK ¶
FilterByUSK is a convenience function that filters products by USK