utils

package
v0.0.0-...-290aaca Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginningOfMonth

func BeginningOfMonth(ts time.Time) time.Time

BeginningOfMonth beginning of month

func EndOfMonth

func EndOfMonth(ts time.Time) time.Time

EndOfMonth end of month

func IPContains

func IPContains(ipMatchers []*IPMatcher, ip string) bool

func PrevOfMonth

func PrevOfMonth(ts time.Time) time.Time

PrevOfMonth

func RandStringBytesMaskImprSrc

func RandStringBytesMaskImprSrc(n int) string

Types

type IPMatcher

type IPMatcher struct {
	IP     net.IP
	SubNet *net.IPNet
}

func NewIPMatcher

func NewIPMatcher(ipStr string) (*IPMatcher, error)

func (IPMatcher) Match

func (m IPMatcher) Match(ipStr string) bool

type IPMatchers

type IPMatchers []*IPMatcher

func NewIPMatchers

func NewIPMatchers(ips []string) (list IPMatchers, err error)

func (IPMatchers) Match

func (ms IPMatchers) Match(ip string) bool

Jump to

Keyboard shortcuts

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