Documentation ¶
Index ¶
- Constants
- func AssetsDir(home string) string
- func ConfigPath(home string) string
- func DBDir(home string, name string) string
- func DidLegacyInformedConsent() bool
- func EngineDir(home string) string
- func EscapeAwareRuneCountInString(s string) int
- func Fatal(err error)
- func FileExists(path string) bool
- func GetOONIHome() (string, error)
- func Log(msg string, v ...interface{})
- func MakeResultsDir(home string, name string, ts time.Time) (string, error)
- func RequiredDirs(home string) []string
- func RightPad(str string, length int) string
- func WrapString(s string, lim uint) string
Constants ¶
const ResultTimestamp = "2006-01-02T150405.999999999Z0700"
ResultTimestamp is a windows friendly timestamp
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
ConfigPath returns the default path to the config file
func DidLegacyInformedConsent ¶
func DidLegacyInformedConsent() bool
DidLegacyInformedConsent checks if the user did the informed consent procedure in probe-legacy
func EngineDir ¶
EngineDir returns the directory where ooni/probe-engine should store its private data given a specific OONI Home.
func EscapeAwareRuneCountInString ¶
EscapeAwareRuneCountInString counts the number of runes in a string taking into account escape sequences.
func FileExists ¶
FileExists returns true if the specified path exists and is a regular file.
func MakeResultsDir ¶
MakeResultsDir creates and returns a directory for the result
func RequiredDirs ¶
RequiredDirs returns the required ooni home directories
func WrapString ¶
WrapString wraps the given string within lim width in characters.
Wrapping is currently naive and only happens at white-space. A future version of the library will implement smarter wrapping. This means that pathological cases can dramatically reach past the limit, such as a very long word. This is taken from: https://github.com/mitchellh/go-wordwrap/tree/f253961a26562056904822f2a52d4692347db1bd
Types ¶
This section is empty.