Documentation ¶
Index ¶
- Variables
- func CompareHashAndPassword(input, hash string) error
- func Contains(a []int, x int) bool
- func ConvertTimeStampToString(timestamp time.Time) string
- func DatetimeLocalToRFC3339(str string) (time.Time, error)
- func GenerateFromPassword(input string) (string, error)
- func GetTimeInCorrectTimeZone() time.Time
- func GoToHTMLDatetimeLocal(t time.Time) string
- func ShuffleIntSlice(slice []int) []int
- type Statistics
- func (s *Statistics) AddEntry(entry float64)
- func (s Statistics) Average() (float64, error)
- func (s Statistics) AveragePercent() (float64, error)
- func (s Statistics) GetDisplayStruct() StatisticsDisplay
- func (s Statistics) Max() float64
- func (s Statistics) Min() float64
- func (s Statistics) Size() int
- func (s Statistics) StandardDeviation() (float64, error)
- func (s Statistics) Sum() float64
- func (s Statistics) Variance() (float64, error)
- type StatisticsDisplay
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDivideByZero error ErrDivideByZero = errors.New("cannot divide by zero") )
Functions ¶
func CompareHashAndPassword ¶
CompareHashAndPassword compares input with hash, returns error if any
func ConvertTimeStampToString ¶
ConvertTimeStampToString converts date to string for inserting in db
func DatetimeLocalToRFC3339 ¶
DatetimeLocalToRFC3339 converts a string from datetime-local HTML input-field to time.Time object
func GenerateFromPassword ¶
GenerateFromPassword returns hashed string with cost 14
func GetTimeInCorrectTimeZone ¶
GetTimeInCorrectTimeZone returns the time in "TIME_ZONE" time
func GoToHTMLDatetimeLocal ¶
GoToHTMLDatetimeLocal converts time.Time object to 'datetime-local' in HTML
Types ¶
type Statistics ¶
Statistics struct
func (*Statistics) AddEntry ¶
func (s *Statistics) AddEntry(entry float64)
AddEntry adds new entry to the slice of entries
func (Statistics) Average ¶
func (s Statistics) Average() (float64, error)
Average value of the all the entries
func (Statistics) AveragePercent ¶
func (s Statistics) AveragePercent() (float64, error)
AveragePercent of all entries based on a set absolute max
func (Statistics) GetDisplayStruct ¶
func (s Statistics) GetDisplayStruct() StatisticsDisplay
GetDisplayStruct returns a struct for displaying the data
func (Statistics) StandardDeviation ¶
func (s Statistics) StandardDeviation() (float64, error)
StandardDeviation func