utils

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllCities []string

Functions

func CreateMapLinkFromAddr

func CreateMapLinkFromAddr(addr, city string) string

CreateMapLinkFromAddr creates a link to Google Maps, built with the address and the city provided

func CreateULID

func CreateULID() string

CreateULID returns a ULID string for database IDs

func GetClosestCityName

func GetClosestCityName(name string) string

GetClosestCityName uses Levenstein distance to find the closest "official" city name. This allows us to correct some mispellings. Currently, the list of all the cities is stored in loaded from a file and is stored in memory.

func RemoveFromSliceOrdered added in v0.1.7

func RemoveFromSliceOrdered(slice []string, s string) []string

RemoveFromSliceOrdered removes a string from a slice and keep the order

func StringInSlice

func StringInSlice(s string, sl []string) bool

StringInSlice returns `true` if s is in sl, `false` otherwise

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL