demo

package
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 16 Imported by: 0

README

介绍

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

Documentation

Index

Constants

View Source
const (
	Unknown Weekday = iota
	Sun
	Mon
	Tues
	Wed
	Thur
	Fri
	Sat
	SunDesc  WeekdayDesc = "sun"
	MonDesc  WeekdayDesc = "mon"
	TuesDesc WeekdayDesc = "Tues"
	WedDesc  WeekdayDesc = "Wed"
	ThurDesc WeekdayDesc = "Thur"
	FriDesc  WeekdayDesc = "Fri"
	SatDesc  WeekdayDesc = "Sat"
)

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

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 added in v1.0.3

type Weekday int //自定义一个星期类型,作为枚举类型

func NewWeekday added in v1.0.32

func NewWeekday(value string) Weekday

func (Weekday) String added in v1.0.3

func (w Weekday) String() string

type WeekdayDesc added in v1.0.32

type WeekdayDesc string

Directories

Path Synopsis
pattern

Jump to

Keyboard shortcuts

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