util

package
v0.0.0-...-25ff90d Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chk

func Chk(err error)

func JsonString

func JsonString(obj interface{}) string

func ParseData

func ParseData(file string) interface{}

Types

type BoolSeq

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

func (*BoolSeq) Next

func (p *BoolSeq) Next() string

type DataSeq

type DataSeq struct {
	Int    ISeq
	Bool   ISeq
	Float  ISeq
	String ISeq
}

func NewDataSeq

func NewDataSeq() *DataSeq

func (*DataSeq) Next

func (p *DataSeq) Next(tp DataSeqTp) string

type DataSeqTp

type DataSeqTp int
const (
	DataSeqTpUnKnown DataSeqTp = iota
	DataSeqTpInt
	DataSeqTpBool
	DataSeqTpFloat
	DataSeqTpString
)

type DomainField

type DomainField struct {
	Name    string
	Type    DomainTp
	MockVal string
	GormTag string
}

type DomainParser

type DomainParser struct {
}

func (*DomainParser) Parse

func (p *DomainParser) Parse(content string) *DomainStruct

type DomainStruct

type DomainStruct struct {
	Name     string
	FileName string
	Fields   []*DomainField
}

type DomainTp

type DomainTp string

func (*DomainTp) GetSeqTp

func (p *DomainTp) GetSeqTp() DataSeqTp

type DomainTpList

type DomainTpList []DomainTp

type FilePath

type FilePath string

func (FilePath) Exist

func (p FilePath) Exist() bool

func (FilePath) FileName

func (p FilePath) FileName() string

func (FilePath) FolderName

func (p FilePath) FolderName() string

func (FilePath) FullPath

func (p FilePath) FullPath() (string, error)

func (FilePath) Open

func (p FilePath) Open() (*os.File, error)

func (FilePath) String

func (p FilePath) String() string

func (FilePath) UnixPath

func (p FilePath) UnixPath() string

func (FilePath) WindowsPath

func (p FilePath) WindowsPath() string

func (FilePath) Writer

func (p FilePath) Writer() (*bufio.Writer, error)

type FileUt

type FileUt struct {
}

func (*FileUt) Exist

func (p *FileUt) Exist(filename string) bool

func (*FileUt) FlushWrite

func (p *FileUt) FlushWrite(path, content string) int

func (*FileUt) FlushWriteBytes

func (p *FileUt) FlushWriteBytes(path string, b []byte) int

func (*FileUt) MakeFile

func (p *FileUt) MakeFile(dir, fileName string) (*os.File, error)

func (*FileUt) MkDir

func (p *FileUt) MkDir(dir string)

func (*FileUt) NewFilePath

func (p *FileUt) NewFilePath(s string) FilePath

func (*FileUt) ReadAll

func (p *FileUt) ReadAll(path string) (string, error)

func (*FileUt) ReadLinesChannel

func (p *FileUt) ReadLinesChannel(filePath string) (<-chan string, error)

func (*FileUt) ReadLinesSlice

func (p *FileUt) ReadLinesSlice(path string) ([]string, error)

func (*FileUt) Remove

func (p *FileUt) Remove(filename string) error

func (*FileUt) WriteLinesSlice

func (p *FileUt) WriteLinesSlice(lines []string, path string) error

type FloatSeq

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

func (*FloatSeq) Next

func (p *FloatSeq) Next() string

type ISeq

type ISeq interface {
	Next() string
}

type IntSeq

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

func (*IntSeq) Next

func (p *IntSeq) Next() string

type Parser

type Parser struct {
	PrepareReg []string
	ProcessReg []string
}

func (*Parser) Exe

func (p *Parser) Exe(content string) []string

type StringSeq

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

func NewStringSeq

func NewStringSeq() *StringSeq

func (*StringSeq) Next

func (p *StringSeq) Next() string

Jump to

Keyboard shortcuts

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