utilities

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Properties

type Properties struct {
	Lines []*PropertyFileLine
	// contains filtered or unexported fields
}

func NewProperties

func NewProperties() *Properties

func (*Properties) GetAsBoolean

func (c *Properties) GetAsBoolean(key string, defaultValue bool) bool

func (*Properties) GetAsDouble

func (c *Properties) GetAsDouble(key string, defaultValue float64) float64

func (*Properties) GetAsInteger

func (c *Properties) GetAsInteger(key string, defaultValue int) int

func (*Properties) GetAsLong

func (c *Properties) GetAsLong(key string, defaultValue int32) int32

func (*Properties) GetAsString

func (c *Properties) GetAsString(key string, defaultValue string) string

func (*Properties) LoadFromFile

func (c *Properties) LoadFromFile(file string)

func (*Properties) SaveToFile

func (c *Properties) SaveToFile(file string)

func (*Properties) SetAsBoolean

func (c *Properties) SetAsBoolean(key string, value bool)

func (*Properties) SetAsDouble

func (c *Properties) SetAsDouble(key string, value float64)

func (*Properties) SetAsInteger

func (c *Properties) SetAsInteger(key string, value int)

func (*Properties) SetAsLong

func (c *Properties) SetAsLong(key string, value int32)

func (*Properties) SetAsString

func (c *Properties) SetAsString(key string, value string)

type PropertyFileLine

type PropertyFileLine struct {
	// contains filtered or unexported fields
}

func NewPropertyFileLine

func NewPropertyFileLine(key string, value string, comment string) *PropertyFileLine

func (*PropertyFileLine) GetComment

func (c *PropertyFileLine) GetComment() string

func (*PropertyFileLine) GetValue

func (c *PropertyFileLine) GetValue() string

func (*PropertyFileLine) Key

func (c *PropertyFileLine) Key() string

func (*PropertyFileLine) Line

func (c *PropertyFileLine) Line() string

func (*PropertyFileLine) SetComment

func (c *PropertyFileLine) SetComment(value string)

func (*PropertyFileLine) SetValue

func (c *PropertyFileLine) SetValue(value string)

func (*PropertyFileLine) ToString

func (c *PropertyFileLine) ToString() string

type TConverter

type TConverter struct {
}
var Converter TConverter = TConverter{}

func (*TConverter) BooleanToString

func (c *TConverter) BooleanToString(value bool) string

func (*TConverter) DoubleToString

func (c *TConverter) DoubleToString(value float64) string

func (*TConverter) FloatToString

func (c *TConverter) FloatToString(value float32) string

func (*TConverter) IntegerToString

func (c *TConverter) IntegerToString(value int) string

func (*TConverter) LongToString

func (c *TConverter) LongToString(value int32) string

func (*TConverter) StringToBoolean

func (c *TConverter) StringToBoolean(value string, defaultValue bool) bool

func (*TConverter) StringToDouble

func (c *TConverter) StringToDouble(value string, defaultValue float64) float64

func (*TConverter) StringToFloat

func (c *TConverter) StringToFloat(value string, defaultValue float32) float32

func (*TConverter) StringToInteger

func (c *TConverter) StringToInteger(value string, defaultValue int) int

func (*TConverter) StringToLong

func (c *TConverter) StringToLong(value string, defaultValue int32) int32

type TFormatter

type TFormatter struct {
}
var Formatter TFormatter = TFormatter{}

func (*TFormatter) FormatDate

func (c *TFormatter) FormatDate(date time.Time) string

func (*TFormatter) FormatNumber

func (c *TFormatter) FormatNumber(value float64, decimals int) string

func (*TFormatter) FormatTime

func (c *TFormatter) FormatTime(date time.Time) string

func (*TFormatter) FormatTimeSpan

func (c *TFormatter) FormatTimeSpan(ticks int64) string

func (*TFormatter) PadLeft

func (c *TFormatter) PadLeft(value string, length int, padSymbol string) string

func (*TFormatter) PadRight

func (c *TFormatter) PadRight(value string, length int, padSymbol string) string

Jump to

Keyboard shortcuts

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