Documentation
¶
Overview ¶
Package internal contains some internal functionalities needed for expipe. Config package contains the logic required for reading configuration from files. Any logic required for converting data types will land in the datatype package. The token package contains only logic required for generating request based tokens. Other commonly used logic are places in the internal package itself. There are numeric and string searches, logging setup, etc.
Index ¶
Examples ¶
Constants ¶
const ( // InfoLevel for Info level InfoLevel = logrus.InfoLevel // WarnLevel for Warn level WarnLevel = logrus.WarnLevel // DebugLevel for Debug level DebugLevel = logrus.DebugLevel // ErrorLevel for Error level ErrorLevel = logrus.ErrorLevel )
Variables ¶
This section is empty.
Functions ¶
func SanitiseURL ¶
SanitiseURL prepends a protocol to the url if not defined, and checks if it's a valid url.
Example ¶
This example shows how to sanitise a URL.
package main import ( "fmt" "github.com/arsham/expipe/internal" ) func main() { res, err := internal.SanitiseURL("http localhost") fmt.Printf("Error: %v\n", err) fmt.Printf("Result: <%s>\n", res) res, err = internal.SanitiseURL("127.0.0.1") fmt.Printf("Error: %v\n", err) fmt.Printf("Result: <%s>\n", res) res, _ = internal.SanitiseURL("https://localhost.localdomain") fmt.Printf("Result: <%s>\n", res) }
Output: Error: invalid url: http localhost Result: <> Error: <nil> Result: <http://127.0.0.1> Result: <https://localhost.localdomain>
func StringInMapKeys ¶
StringInMapKeys returns true if niddle is in the haystack's keys
func StringInSlice ¶
StringInSlice returns true if niddle is in the haystack
Types ¶
type InvalidURLError ¶ added in v0.9.2
type InvalidURLError string
InvalidURLError is returned when the URL is not a valid one.
func (InvalidURLError) Error ¶ added in v0.9.2
func (i InvalidURLError) Error() string
Error returns the string representation of the error.