utils

package
v0.0.0-...-d0afcd5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2021 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package utils contains utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMD5Hash

func GetMD5Hash(text string) string

GetMD5Hash generates a simple MD5 hash from a string

func ParsePercentage

func ParsePercentage(value string) (float32, error)

Parses 67.25% to 0.6725

Types

type EmailSender

type EmailSender struct {
	Host string
	Port uint

	User     string
	Password string
}

func NewEmailSender

func NewEmailSender(Host string, Port uint, Username, Password string) *EmailSender

func (*EmailSender) SendRawMail

func (sender *EmailSender) SendRawMail(to []string, msg string) error

func (*EmailSender) WriteEmail

func (sender *EmailSender) WriteEmail(dest []string, contentType, subject, bodyMessage string) string

func (*EmailSender) WriteHTMLEmail

func (sender *EmailSender) WriteHTMLEmail(dest []string, subject, bodyMessage string) string

func (*EmailSender) WritePlainEmail

func (sender *EmailSender) WritePlainEmail(dest []string, subject, bodyMessage string) string

type PercentageValue

type PercentageValue float32

-- percentage Value

func NewPercentageValue

func NewPercentageValue(val float32, p *float32) *PercentageValue

func (*PercentageValue) Get

func (i *PercentageValue) Get() interface{}

func (*PercentageValue) Set

func (i *PercentageValue) Set(s string) error

func (*PercentageValue) String

func (i *PercentageValue) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL