demo

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 16 Imported by: 0

README

介绍

demo目录中的文件,是用于记录常用的代码片段,并不提供具体的函数功能,方便快速查看具体使用方式

Documentation

Index

Constants

View Source
const ProblemModule = "problem"

Variables

This section is empty.

Functions

func InitLog

func InitLog()

func LogModule

func LogModule(module string, fields ...map[string]interface{}) *logrus.Entry

func LogWithCtx

func LogWithCtx(ctx context.Context, module string, fields ...map[string]interface{}) *logrus.Entry

func TopKFrequent

func TopKFrequent(words []string, k int) []string

Types

type Item

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

type ItemHeap

type ItemHeap []Item

func (ItemHeap) Len

func (h ItemHeap) Len() int

func (ItemHeap) Less

func (h ItemHeap) Less(i, j int) bool

func (*ItemHeap) Pop

func (h *ItemHeap) Pop() interface{}

func (*ItemHeap) Push

func (h *ItemHeap) Push(val interface{})

func (ItemHeap) Swap

func (h ItemHeap) Swap(i, j int)

type LeaveType

type LeaveType = string
const (
	AnnualLeave LeaveType = "AnnualLeave"
	Sick        LeaveType = "Sick"
	BankHoliday LeaveType = "BankHoliday"
	Other       LeaveType = "Other"
)

type Weekday

type Weekday int //自定义一个星期类型,作为枚举类型
const (
	Sun Weekday = iota + 1
	Mon
	Tues
	Wed
	Thur
	Fri
	Sat
)

这里必须要+1,不然会导致有默认值错误

func (Weekday) String

func (w Weekday) String() string

Directories

Path Synopsis
pattern

Jump to

Keyboard shortcuts

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