tools

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SVCNotFound = []byte(`<svg width="580" height="400" xmlns="http://www.w3.org/2000/svg">
 <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
 <g>
  <title>background</title>
  <rect fill="#fff" id="canvas_background" height="402" width="582" y="-1" x="-1"/>
  <g display="none" overflow="visible" y="0" x="0" height="100%" width="100%" id="canvasGrid">
   <rect fill="url(#gridpattern)" stroke-width="0" y="0" x="0" height="100%" width="100%"/>
  </g>
 </g>
 <g>
  <title>Layer 1</title>
  <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="24" id="svg_1" y="68.453125" x="62.5" stroke-width="0" stroke="#000" fill="#000000">User not found</text>
  <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="24" id="svg_4" y="149.453125" x="62.5" fill-opacity="null" stroke-opacity="null" stroke-width="0" stroke="#000" fill="#000000">https://github.com/haozibi/leetcode-badge</text>
 </g>
</svg>`)
View Source
var SVGLackData = []byte(`<svg width="580" height="400" xmlns="http://www.w3.org/2000/svg">
 <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
 <g>
  <title>background</title>
  <rect fill="#fff" id="canvas_background" height="402" width="582" y="-1" x="-1"/>
  <g display="none" overflow="visible" y="0" x="0" height="100%" width="100%" id="canvasGrid">
   <rect fill="url(#gridpattern)" stroke-width="0" y="0" x="0" height="100%" width="100%"/>
  </g>
 </g>
 <g>
  <title>Layer 1</title>
  <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="24" id="svg_1" y="68.453125" x="62.5" stroke-width="0" stroke="#000" fill="#000000">Lack of data</text>
  <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="24" id="svg_3" y="106.453125" x="59.5" fill-opacity="null" stroke-opacity="null" stroke-width="0" stroke="#000" fill="#000000">At least two days of data</text>
  <text xml:space="preserve" text-anchor="start" font-family="Helvetica, Arial, sans-serif" font-size="24" id="svg_4" y="149.453125" x="58.5" fill-opacity="null" stroke-opacity="null" stroke-width="0" stroke="#000" fill="#000000">https://github.com/haozibi/leetcode-badge</text>
 </g>
</svg>`)

Functions

func BoolToInt

func BoolToInt(b bool) int

BoolToInt bool to int

func Exists added in v0.3.0

func Exists(path string) bool

Exists 判断文件、文件夹是否存在

func IntToBool

func IntToBool(n int) bool

IntToBool int to bool

func IsDir added in v0.3.0

func IsDir(path string) bool

IsDir 判断所给路径是否为文件夹

func IsFile added in v0.3.0

func IsFile(path string) bool

IsFile 判断所给路径是否为文件

func IsToday

func IsToday(t time.Time) bool

IsToday 判断时间是否是今天

func Struct2Map

func Struct2Map(obj interface{}) map[string]interface{}

Struct2Map struct to map

func ZeroTime

func ZeroTime(t time.Time) time.Time

ZeroTime 返回当天的零点时间,时区 UTC+8

Types

type WaitGroupWrapper added in v0.3.0

type WaitGroupWrapper struct {
	sync.WaitGroup
}

WaitGroupWrapper wrap sync.WaitGroup

func (*WaitGroupWrapper) Wrap added in v0.3.0

func (w *WaitGroupWrapper) Wrap(cb func())

Wrap wrap

Jump to

Keyboard shortcuts

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