lirity

package module
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 9 Imported by: 0

README

lirity

lirity提供一些基础工具库

Documentation

Overview

Package lirity

Index

Constants

View Source
const (
	Exit = 1 << iota
	ResetTime
)

Variables

This section is empty.

Functions

func Bytes

func Bytes(s string) (b []byte)

Bytes cost-free conversion of characters to byte streams

func Close

func Close(c io.Closer)

Close clear ,use defer

func DirSize

func DirSize(path string) (size int64, count int, err error)

DirSize 统计文件夹的大小

func String

func String(b []byte) (s string)

String cost-free conversion of byte stream to character

func Struct2Map

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

func Struct2MapWithTag added in v1.1.5

func Struct2MapWithTag(s interface{}, tagName string) map[string]interface{}

Types

type FileOrContent

type FileOrContent string

func (FileOrContent) IsPath

func (f FileOrContent) IsPath() bool

IsPath returns true if the FileOrContent is a file path, otherwise returns false.

func (FileOrContent) Read

func (f FileOrContent) Read() ([]byte, error)

func (FileOrContent) String

func (f FileOrContent) String() string

type Status added in v1.1.5

type Status struct {
	Flag int
}

Status 存储目前的状态

func (*Status) AddStatus added in v1.1.5

func (s *Status) AddStatus(status int)

AddStatus 添加一种或多种状态

func (*Status) DeleteStatus added in v1.1.5

func (s *Status) DeleteStatus(status int)

DeleteStatus 删除一种或者多种状态

func (*Status) HasStatus added in v1.1.5

func (s *Status) HasStatus(status int) bool

HasStatus 是否具有某些状态

func (*Status) NotHasStatus added in v1.1.5

func (s *Status) NotHasStatus(status int) bool

NotHasStatus 是否不具有某些状态

func (*Status) OnlyHas added in v1.1.5

func (s *Status) OnlyHas(status int) bool

OnlyHas 是否仅仅具有某些状态

func (*Status) SetStatus added in v1.1.5

func (s *Status) SetStatus(status int)

SetStatus 设置状态

Directories

Path Synopsis
Package client is a generated GoMock package.
Package client is a generated GoMock package.
Package command
Package command
e
Package mq
Package mq
Package registry
Package registry
Package variable
Package variable

Jump to

Keyboard shortcuts

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