utils

package module
v0.0.0-...-dac1f72 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BreakSignal

func BreakSignal() (sc chan os.Signal)

Listen Kill,Term,Interupt to Channel

func ConvBtoI

func ConvBtoI(b []byte) int

Byte を intに

func PrintError

func PrintError(message string, err error) (errored bool)

Error表示

func Rand

func Rand(max int) (result int)

Rand Generate 0~max-1

func RegMatch

func RegMatch(text string, check string) (match bool)

Regexp Match

func RegReplace

func RegReplace(fromText string, toText string, check string) (replaced string)

Regexp Replace

func ResetPrintBackColor

func ResetPrintBackColor()

背景の色を元に戻す

func ResetPrintWordColor

func ResetPrintWordColor()

文字の色を元に戻す

func SetPrintBackColor

func SetPrintBackColor(r int, g int, b int)

背景の色を変える

func SetPrintWordColor

func SetPrintWordColor(r int, g int, b int)

文字の色を変える

func StrCut

func StrCut(text, suffix string, max int) (result string)

String Cut

Types

type ExMap

type ExMap struct {
	Sm sync.Map
}

func NewExMap

func NewExMap() *ExMap

排他的Mapを入手

func (*ExMap) Check

func (m *ExMap) Check(key string) (ok bool)

func (*ExMap) Delete

func (m *ExMap) Delete(key string)

func (*ExMap) Read

func (m *ExMap) Read(key string, v any) (err error)

func (*ExMap) Write

func (m *ExMap) Write(key string, value any)

type LogLevel

type LogLevel int
const (
	Info LogLevel = iota
	Warn
	Error
)

type LoggerHandler

type LoggerHandler struct {
	Level LogLevel
}

func (*LoggerHandler) Error

func (l *LoggerHandler) Error(arg ...any)

func (*LoggerHandler) Info

func (l *LoggerHandler) Info(arg ...any)

func (*LoggerHandler) Warn

func (l *LoggerHandler) Warn(arg ...any)

Jump to

Keyboard shortcuts

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