Documentation ¶
Overview ¶
Helper functions for reading/writing data.
Index ¶
- func InterfaceSlice(slice interface{}) []interface{}
- func ReadCsvFile(filePath string) [][]string
- func ReadFileLines(filePath string) []string
- func ReadFileLinesOrNil(filePath string) []string
- func ReadMap(filePath string) map[string]string
- func ReadMapOrNil(filePath string) map[string]string
- func ReadWebMulti(urls []string) []string
- func ReadWebMultiMap[K comparable](keys []K, keyToUrl func(K) string) map[K]string
- func WriteFileLines(filePath string, lines []string)
- func WriteMap(filePath string, contents map[string]string)
- func WriteMapCustomSort(filePath string, contents map[string]string, sortFunc func(a, b string) bool)
- func WriteMapSortByIntKey(filePath string, contents map[string]string)
- func WriteProtoArrayToBuilder(arrInterface interface{}, builder *strings.Builder, name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InterfaceSlice ¶
func InterfaceSlice(slice interface{}) []interface{}
Needed because Go won't let us cast from []FooProto --> []googleProto.Message https://stackoverflow.com/questions/12753805/type-converting-slices-of-interfaces
func ReadCsvFile ¶
func ReadFileLines ¶
func ReadFileLinesOrNil ¶
func ReadMapOrNil ¶
func ReadWebMulti ¶
Fetches web results from all the given urls, and returns a parallel array of page contents.
func ReadWebMultiMap ¶
func ReadWebMultiMap[K comparable](keys []K, keyToUrl func(K) string) map[K]string
Like ReadWebMulti, but uses a lambda function for converting keys --> urls and returns a map of keys to web contents.
func WriteFileLines ¶
func WriteMapCustomSort ¶ added in v0.1.6
func WriteMapSortByIntKey ¶ added in v0.1.6
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.