Documentation ¶
Index ¶
- Variables
- func AddToCollection(url string) bool
- func ManualUpdate()
- func RemoveFromCollection()
- func Search(url, nameToSearch string)
- func SearchByHouse(house, name string)
- func SearchByName(name string)
- func SetPath()
- func ShowOptionsAndGetNumericInput(collection FragranceCollection) int
- func ShowOptionsByBrandAndGetNumericInput(collection FragranceCollection) int
- type BasicInfo
- type FragranceCollection
- type FragranceItem
Constants ¶
This section is empty.
Variables ¶
var MASTER string
MASTER is the master collecion filepath, when an item is added, master is regenerated in alphabetical order
var PATH string
PATH is the location of the directory where the jsons are stored
Functions ¶
func AddToCollection ¶
AddToCollection takes a url string and builds the corresponding fragrance item and adds it to the JSON
func ManualUpdate ¶
func ManualUpdate()
ManualUpdate updates the rest of the json file when called, for example if someone were to manually add something to the file
func RemoveFromCollection ¶
func RemoveFromCollection()
RemoveFromCollection takes the name of the fragrance to remove, removes it from the collection and then regenerated the json file
func Search ¶
func Search(url, nameToSearch string)
Search goes through the search page on basenotes and tries to find a match, otherwise it gives the available options
func SearchByHouse ¶
func SearchByHouse(house, name string)
SearchByHouse searches basenotes by fragrance house first and then by
func SearchByName ¶
func SearchByName(name string)
SearchByName will do a search on BaseNotes for the fragrance name inputted, if no exact match is found, a list of options will be given
func ShowOptionsAndGetNumericInput ¶
func ShowOptionsAndGetNumericInput(collection FragranceCollection) int
ShowOptionsAndGetNumericInput displays the fragrances in the collection and gets the users selection
func ShowOptionsByBrandAndGetNumericInput ¶
func ShowOptionsByBrandAndGetNumericInput(collection FragranceCollection) int
ShowOptionsByBrandAndGetNumericInput displays the fragrances by brand and get the selection
Types ¶
type FragranceCollection ¶
type FragranceCollection struct { MasterCollection map[string]FragranceItem FragrancesByName []BasicInfo FragrancesByHouse []BasicInfo Notes map[string][]BasicInfo }
FragranceCollection is used to hold a collection of FragranceItems
func ReadInCollection ¶
func ReadInCollection(filePath string) FragranceCollection
ReadInCollection reads a file and outputs a FragranceCollection
type FragranceItem ¶
type FragranceItem struct { BasicInfo FlatNotes []string Pyramid notesPyramid Link string Blurb string }
FragranceItem type contains fragrance info and all notes in a pyramid (if applicable) and flat list of scent notes
func BuildFragranceItem ¶
func BuildFragranceItem(url string) FragranceItem
BuildFragranceItem receives a URL (from basenotes fragrance directory) and returns a FragranceItem with the corresponding information