repositorypackage
0.0.0-20240128143806-0350bc7bc4aa
Repository: https://github.com/ethanvc/evo.git
Documentation: pkg.go.dev
# Packages
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
# README
evo 
Usage
Add dependency to your golang project:
go get github.com/ethanvc/evo
Import in your golang project:
import "github.com/ethanvc/evo"
evohttp
Example: auto parse url param and body to request struct:
createUser := func(c context.Context, req *CreateUserReq)(*CreateUserResp, error){
...
}
svr := NewServer()
svr.POST("/api/users/:user_id", NewStdHandlerF(createUser))
evolog
Extend slog's function.
- trace id support.
- filed mask support. user can mark struct filed server.goand then log library will mask sensitive data for you.
Examples: mask sensitive field.
type Abc struct {
Name string `evolog:"ignore"`
}
abc := &Abc{Name: "test"}
slog.InfoContext(c, "MaskSensitiveField", slog.Any("abc", abc))
base
Some base utils commonly used:
- type safe SyncMap.
- error code based Status inspired from grpc. So you can just process limited and unified error codes.
evores
Library to obtain cpu/memory and others resources in process perspective.
This Library will consider cgroup limit.