Documentation ¶
Index ¶
- Constants
- func AcceptedMediaType(r *http.Request, validList []string) error
- func Decrypt(data, password string) (string, error)
- func Encrypt(data, password string) (string, error)
- func ErrorResponse(w http.ResponseWriter, sessionID int32, msg string, status int)
- func HasCapitalizedName(name string) bool
- func Hash(key string) string
- func Hostname() string
- func InList(s string, test ...string) bool
- func InterfaceMapKeys(data map[string]interface{}) []string
- func MakeBaseCollection(sessionID int32) defs.BaseCollection
- func MakeServerInfo(sessionID int32) defs.ServerInfo
- func MakeSortedArray(array []string) *data.Array
- func SessionLog(id int32, text string) string
- func Unquote(s string) string
- func ValidateParameters(u *url.URL, validation map[string]string) error
Constants ¶
const ( FlagParameterType = "flag" BoolParameterType = "bool" IntParameterType = "int" StringParameterType = "string" ListParameterType = "list" )
Variables ¶
This section is empty.
Functions ¶
func AcceptedMediaType ¶
AcceptedMediaType validates the media type in the "Accept" header for this request against a list of valid media types. This includes common types that are always accepted, as well as additional types provided as paraameters to this function call. The result is a nil error value if the media type is valid, else an error indicating that there was an invalid media type found.
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, sessionID int32, msg string, status int)
func HasCapitalizedName ¶
HasCapitalizedName returns true if the first rune/character of the string is considered a capital letter in Unicode.
func Hash ¶
Hash creates a hash string from a key string. The hash cannot be reversed back into the key string, but two instances of the same key string result in the same hash value.
func Hostname ¶
func Hostname() string
Hostname gets a short form of the host namme (i.e. the first part of an FQDN).
func InList ¶
InList is a support function that checks to see if a string matches any of a list of other strings.
func InterfaceMapKeys ¶
func MakeBaseCollection ¶
func MakeBaseCollection(sessionID int32) defs.BaseCollection
func MakeServerInfo ¶
func MakeServerInfo(sessionID int32) defs.ServerInfo
func MakeSortedArray ¶
Given a list of strings, convert them to a sorted list in Ego array format.
func SessionLog ¶
Session log is used to take a multi-line message for the server log, and insert prefixes on each line with the session number so the log lines will be tagged with the appropriate session identifier, and can be read with the server log query for a specific session.
func ValidateParameters ¶
ValidateParameters checks the parameters in a previously-parsed URL against a map describing the expected parameters and types. IF there is no error, the function returns nil, else an error describing the first parameter found that was invalid.
Types ¶
This section is empty.