funcmap

package
v0.0.0-...-d827e98 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Add

func Add(a, b int64) int64

`b` + `a`

func Basename

func Basename(path string, extensions ...string) string

func CIDRNext

func CIDRNext(cidr uint8, lowest, count, inc int8, addr []int64) []int64

TODO increment CIDR

func Cleanse

func Cleanse(r string) func(string) string

func Cleanser

func Cleanser(r, s string) string

func CommandLine

func CommandLine() string

Reproduce a command line string that reflects a usable command line.

func Debug

func Debug(any ...interface{}) string

func Debugger

func Debugger() (func() bool, func() bool)

toggle debugging

func DecToInt

func DecToInt(arr []string) []int64

func Div

func Div(a, b int64) int64

`b` / `a`

func Environment

func Environment(n string) string

func FromInt

func FromInt(format string, arr []int64) []string

func HexToInt

func HexToInt(arr []string) []int64

func IP4Add

func IP4Add(group uint8, lowest, count uint8, inc int8, addr []int64) []int64

Given a zero-based, left-to-right IP group index, lowest value, count, and increment, increment the group, cyclically.

func IP4Inc

func IP4Inc(group uint8, inc int8, addr string) string

func IP4Join

func IP4Join(addr []int64) string

func IP4Next

func IP4Next(group uint8, lowest, count uint8, addr string) string

func IP4Prev

func IP4Prev(group uint8, lowest, count uint8, addr string) string

func IP6Add

func IP6Add(group uint8, lowest, count uint16, inc int16, addr []int64) []int64

given a group, lowest, count, and increment, increment the group, circling around

func IP6Inc

func IP6Inc(group uint8, inc int16, addr string) string

func IP6Join

func IP6Join(addr []int64) string

func IP6Next

func IP6Next(group uint8, lowest, count uint16, addr string) string

func IP6Prev

func IP6Prev(group uint8, lowest, count uint16, addr string) string

func IPAdd

func IPAdd(bits int32, group uint8, lowest, count uint16, inc int16, addr []int64) []int64

Given a zero-based, left-to-right IP group index, lowest value, count, and increment, increment the group, cyclically.

func IPCalc

func IPCalc(bits int32, lowest, count, inc, value int64) int64

func IPInts

func IPInts(addr string) []int64

func IPMath

func IPMath(math, addr string) string

Performs IP math using a simple sequence of operations. e.g. _.[+2]._.[+1,%10]

func IPSplit

func IPSplit(addr string) []string

func Index

func Index(i int, a interface{}) interface{}

func IntParser

func IntParser(base int) func(s string) (int64, error)

func IntSlice

func IntSlice(start, count int64) []int64

func Join

func Join(sep string, arr []string) (s string)

func KeySequencer

func KeySequencer() func(string) int64

key-based sequencing.

func Mod

func Mod(a, b int64) int64

`b` modulo `a`

func Mul

func Mul(a, b int64) int64

`b` * `a`

func New

func New(options ...Optional) template.FuncMap

func Pause

func Pause(t int64) time.Time

func Rand

func Rand() int64

func ReInitcap

func ReInitcap(s string) string

func ReReplace

func ReReplace(n int, old, new, s string) string

func ReTrim

func ReTrim(cut, s string) string

func ReTrimLeft

func ReTrimLeft(cut, s string) string

func ReTrimRight

func ReTrimRight(cut, s string) string

func SafeDiv

func SafeDiv(a, b int64) int64

`b` divided by `a`. Returns `0` if `a == 0`.

func Sequencer

func Sequencer() func() int64

simple sequence generation.

func Split

func Split(sep, s string) []string

func Starter

func Starter() func() time.Time

To report a consistent time through a single template.

func Step

func Step(a int64, is ...int) int64

func Sub

func Sub(a, b int64) int64

`b` - `a`

func Substr

func Substr(start, end int, s string) string

func ToInt

func ToInt(base int, arr []string) []int64

Types

type Optional

type Optional func(*opt)

func WithClock

func WithClock(timeFunc clock.TimeFunction) Optional

func WithMap

func WithMap(fs template.FuncMap) Optional

func WithMaps

func WithMaps(fs ...template.FuncMap) Optional

func WithRightmostOverrides

func WithRightmostOverrides() Optional

func WithV1Map

func WithV1Map() Optional

func WithV2Map

func WithV2Map() Optional

func WithV3Map

func WithV3Map() Optional

Jump to

Keyboard shortcuts

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