Categorygithub.com/go-zing/gozz-core
modulepackage
0.0.0-20231117165158-0fa2eba2e39f
Repository: https://github.com/go-zing/gozz-core.git
Documentation: pkg.go.dev

# README

logo

Go Go Report Card Go Reference

License: MIT Last Commit codecov

Documentation

English | 简体中文

Introduction

gozz-core provides core packages separated from gozz. contains core typing and code-generate utils for better independent plugin package referenced.

Why they independent

In Golang plugin, module with same name loaded should be compiled in same version.

So we have great reason to reduce core dependencies of gozz in go.mod then provide greater independence.

License

Apache-2.0

# Functions

Appendf format string and values by fmt.Fprintf and append into strings slice.
AssertFuncType to assert interface fields as function type and try return name.
Bytesf format string and values by fmt.Fprintf and return byte slice.
No description provided by the author
No description provided by the author
ExecCommand execute command in provide directory and get stdout,stderr as string,error.
ExecuteTemplate parse provide text template and execute template data into writer.
No description provided by the author
ExtractStructFieldsNames extracts struct exported fields names.
FixPackage modify or add selector package to provide name according to src and dst import module info.
GetImportName get filename or directory module import name if file is not exist then return a relative calculated result from module environments.
GetImportName get filename or directory module import path if file is not exist then return a relative calculated result from module environments.
GetModFile get directory direct mod file by execute "go env GOMOD".
GetOrmSchemaDriver get OrmSchemaDriver from ormSchemaDriverRegistry by name.
GetOrWriteDefault try read filename or write default data.
No description provided by the author
No description provided by the author
IsGoFile check path is valid golang file and ignore test file.
IsStandardImportPath check import path is whether golang standard library.
IterateOrmFieldMapper range slice and apply function receive OrmFieldMapper.
No description provided by the author
KebabCase converts a string into kebab case.
LoadExtension load filename and lookup symbol named "Z" symbol object should implement Plugin or OrmSchemaDriver.
LoadImports parse *ast.File import spec list as Imports map.
LookupTypSpec lookup typename in package src path.
LowerCamelCase converts a string into camel case starting with a lower case letter.
OrmTypeMapping provides default type mapping from sql datatype and golang type.
ParseCommentGroup extract comment group text and split by lines if line match annotation prefix then append line to annotations else append line to docs.
ParseDecls check declaration type parse generic declaration or function declaration and get annotated declarations.
ParseFile try read file data and parse ast file.
ParseFileDecls parse provided file into ast and analysis declarations annotations return annotated declarations list or error while reading file or parsing ast.
ParseFileOrDirectory try parse provided path annotated declarations with annotations prefix if directory provided.
ParseFuncDecl parse function declaration docs to match annotations prefix Example: // +zz:annotation:args:key=value func Foo() { }.
ParseGenericDecl parse generic declaration to match annotation prefix.
No description provided by the author
ReadFile try read filename and return data bytes.
RegisterOrmSchemaDriver registers OrmSchemaDriver to ormSchemaDriverRegistry.
No description provided by the author
RenderTemplate render golang file template and generate headers.
No description provided by the author
RenderWrite render golang file template and write into filename.
ScanSqlRows scan iterator slice and scan sql.Rows values into iterated OrmFieldMapper elements.
SnakeCase converts a string into snake case.
SplitKV2Map split string into in key-value pairs by separator.
SplitKV2Map split string into in key-value pairs by separator and set key-value into dst map.
SplitKVSlice2Map split strings into in key-value pairs by separator and set key-value into dst map.
TrimPrefix check strings has prefix and return trimmed string and check result.
TryExecuteTemplate try execute template, if success replace value to string pointer.
No description provided by the author
No description provided by the author
No description provided by the author
UpperCamelCase converts a string into camel case starting with a upper case letter.
UpperKebabCase converts a string into kebab case with capital letters.
UpperSnakeCase converts a string into snake case with capital letters.
WalkDir walks directory provide but does not walk subdirectory.
WalkPackage walk package directory and parse file as *File.
WriteFile checks data and exists filename md5 sum and update data if file not exists or md5 sum not matched.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
func Fn().
type T []string.
type T func().
type T interface{}.
type T map[string]string.
type T T2 or type T = T2.
type T struct{}.
var variable = 1 or var v Type or const constant = 1.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
SkipDirs contains some directory name would skip in walk.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
ErrGroup is a simple version of golang.org/x/sync/errgroup.Group.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
VersionStore provide a store with source load like single-flights and versioned cache store.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
KeySet provide a unique key set to deduplicated and sort keys.
No description provided by the author
No description provided by the author