github.com/webonyx/up@v0.7.4-0.20180808230834-91b94e551323/platform/aws/cost/domains.go (about) 1 package cost 2 3 import ( 4 "encoding/csv" 5 "strings" 6 7 "github.com/apex/log" 8 ) 9 10 // tlds is a map of tlds to price. 11 var tlds = map[string]string{} 12 13 // Domain returns the price of domain's tld. 14 func Domain(domain string) string { 15 return TLD(strings.SplitN(domain, ".", 2)[1]) 16 } 17 18 // TLD returns the price of a tld. 19 func TLD(tld string) string { 20 return tlds[tld] 21 } 22 23 // priceList is a raw CSV price list. 24 var priceList = ` 25 ac,$48.00 26 academy,$32.00 27 accountants,$94.00 28 adult,$88.00 29 agency,$19.00 30 apartments,$47.00 31 associates,$29.00 32 auction,$29.00 33 audio,$13.00 34 band,$22.00 35 bargains,$30.00 36 be,$9.00 37 berlin,$52.00 38 bike,$32.00 39 bingo,$47.00 40 biz,$12.00 41 black,$43.00 42 blue,$15.00 43 boutique,$30.00 44 builders,$32.00 45 business,$18.00 46 buzz,$37.00 47 ca,$13.00 48 cab,$32.00 49 cafe,$31.00 50 camera,$46.00 51 camp,$46.00 52 capital,$47.00 53 cards,$29.00 54 care,$29.00 55 careers,$35.00 56 cash,$29.00 57 casino,$141.00 58 catering,$29.00 59 cc,$12.00 60 center,$21.00 61 ceo,$74.00 62 ch,$12.00 63 chat,$29.00 64 cheap,$30.00 65 church,$29.00 66 city,$19.00 67 cl,$93.00* 68 cloud,$23.00 69 claims,$47.00 70 cleaning,$46.00 71 click,$7.00 72 clinic,$47.00 73 clothing,$32.00 74 club,$12.00 75 co,$25.00 76 co.nz,$24.00 77 co.uk,$9.00 78 co.za,$13.00 79 coach,$47.00 80 codes,$35.00 81 coffee,$32.00 82 college,$69.00 83 com,$12.00 84 com.ar,$76.00* 85 com.au,$15.00 86 com.br,$58.00* 87 com.mx,$34.00 88 com.sg,$47.00* 89 community,$29.00 90 company,$18.00 91 computer,$32.00 92 condos,$49.00 93 construction,$32.00 94 consulting,$29.00 95 contractors,$32.00 96 cool,$30.00 97 coupons,$51.00 98 credit,$94.00 99 creditcard,$141.00 100 cruises,$49.00 101 dance,$22.00 102 dating,$49.00 103 de,$9.00 104 deals,$29.00 105 delivery,$47.00 106 democrat,$30.00 107 dental,$47.00 108 diamonds,$35.00 109 diet,$19.00 110 digital,$29.00 111 direct,$29.00 112 directory,$21.00 113 discount,$29.00 114 dog,$46.00 115 domains,$32.00 116 education,$21.00 117 email,$25.00 118 energy,$94.00 119 engineering,$47.00 120 enterprises,$32.00 121 equipment,$21.00 122 es,$10.00 123 estate,$32.00 124 eu,$13.00 125 events,$30.00 126 exchange,$29.00 127 expert,$49.00 128 exposed,$19.00 129 express,$31.00 130 fail,$29.00 131 farm,$32.00 132 fi,$24.00 133 finance,$47.00 134 financial,$47.00 135 fish,$29.00 136 fitness,$29.00 137 flights,$49.00 138 florist,$32.00 139 flowers,$25.00 140 fm,$92.00 141 football,$19.00 142 forsale,$29.00 143 foundation,$30.00 144 fr,$12.00 145 fund,$47.00 146 furniture,$47.00 147 futbol,$12.00 148 fyi,$20.00 149 gallery,$21.00 150 gg,$75.00 151 gift,$20.00 152 gifts,$19.00 153 glass,$46.00 154 global,$71.00 155 gold,$101.00 156 golf,$51.00 157 graphics,$21.00 158 gratis,$19.00 159 green,$71.00 160 gripe,$29.00 161 guide,$29.00 162 guitars,$30.00 163 guru,$25.00 164 haus,$29.00 165 healthcare,$47.00 166 help,$19.00 167 hiv,$254.00 168 hockey,$51.00 169 holdings,$35.00 170 holiday,$35.00 171 host,$93.00 172 hosting,$29.00 173 house,$32.00 174 im,$19.00 175 immo,$29.00 176 immobilien,$30.00 177 in,$15.00 178 industries,$29.00 179 info,$12.00 180 ink,$29.00 181 institute,$21.00 182 insure,$47.00 183 international,$21.00 184 investments,$94.00 185 io,$39.00 186 irish,$36.00 187 it,$15.00 188 jewelry,$51.00 189 jp,$90.00 190 juegos,$13.00 191 kaufen,$30.00 192 kim,$15.00 193 kitchen,$46.00 194 kiwi,$32.00 195 land,$32.00 196 lease,$47.00 197 legal,$47.00 198 lgbt,$43.00 199 life,$29.00 200 lighting,$21.00 201 limited,$29.00 202 limo,$35.00 203 link,$10.00 204 live,$23.00 205 loan,$31.00 206 loans,$94.00 207 lol,$31.00 208 maison,$49.00 209 management,$21.00 210 marketing,$32.00 211 mba,$31.00 212 me,$17.00 213 me.uk,$8.00 214 media,$29.00 215 memorial,$47.00 216 mobi,$12.00 217 moda,$22.00 218 money,$29.00 219 mortgage,$43.00 220 movie,$306.00 221 mx,$34.00 222 name,$9.00 223 net,$11.00 224 net.au,$15.00 225 net.nz,$24.00 226 network,$19.00 227 news,$23.00 228 ninja,$18.00 229 nl,$10.00 230 onl,$15.00 231 online,$39.00 232 org,$12.00 233 org.nz,$24.00 234 org.uk,$9.00 235 partners,$49.00 236 parts,$29.00 237 photo,$30.00 238 photography,$21.00 239 photos,$21.00 240 pics,$20.00 241 pictures,$10.00 242 pink,$15.00 243 pizza,$47.00 244 place,$29.00 245 plumbing,$46.00 246 plus,$31.00 247 poker,$43.00 248 porn,$88.00 249 pro,$14.00 250 productions,$30.00 251 properties,$30.00 252 property,$29.00 253 pub,$22.00 254 qa,$64.00* 255 qpon,$15.00 256 recipes,$35.00 257 red,$15.00 258 reise,$101.00 259 reisen,$19.00 260 rentals,$30.00 261 repair,$32.00 262 report,$19.00 263 republican,$29.00 264 restaurant,$47.00 265 reviews,$22.00 266 rip,$17.00 267 rocks,$12.00 268 ru,$36.00 269 ruhr,$30.00 270 run,$20.00 271 sale,$29.00 272 sarl,$29.00 273 school,$29.00 274 schule,$19.00 275 se,$23.00 276 services,$29.00 277 sex,$95.00 278 sexy,$22.00 279 sg,$47.00* 280 sh,$48.00 281 shiksha,$16.00 282 shoes,$46.00 283 show,$31.00 284 singles,$30.00 285 soccer,$20.00 286 social,$32.00 287 solar,$46.00 288 solutions,$25.00 289 studio,$23.00 290 style,$29.00 291 sucks,$282.00 292 supplies,$19.00 293 supply,$19.00 294 support,$21.00 295 surgery,$47.00 296 systems,$21.00 297 tattoo,$30.00 298 tax,$47.00 299 taxi,$51.00 300 team,$31.00 301 technology,$21.00 302 tennis,$47.00 303 theater,$51.00 304 tienda,$50.00 305 tips,$21.00 306 tires,$94.00 307 today,$21.00 308 tools,$29.00 309 tours,$51.00 310 town,$29.00 311 toys,$46.00 312 trade,$29.00 313 training,$27.00 314 tv,$32.00 315 uk,$9.00 316 university,$47.00 317 uno,$30.00 318 us,$15.00 319 vacations,$35.00 320 vc,$33.00 321 vegas,$57.00 322 ventures,$35.00 323 vg,$35.00 324 viajes,$49.00 325 video,$22.00 326 villas,$35.00 327 vision,$29.00 328 voyage,$50.00 329 watch,$37.00 330 website,$23.00 331 wien,$29.00 332 wiki,$30.00 333 works,$30.00 334 world,$29.00 335 wtf,$29.00 336 xyz,$12.00 337 zone,$32.00 338 ` 339 340 func init() { 341 r := csv.NewReader(strings.NewReader(priceList)) 342 343 rows, err := r.ReadAll() 344 if err != nil { 345 log.WithError(err).Debug("reading price list") 346 return 347 } 348 349 for _, row := range rows { 350 name := row[0] 351 price := row[1] 352 tlds[name] = price 353 } 354 }