evo

module
v0.0.0-...-0350bc7 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0

README

evo Godoc

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.

  1. trace id support.
  2. 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:

  1. type safe SyncMap.
  2. 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.

Directories

Path Synopsis
xsemaphore
Package semaphore provides a weighted semaphore implementation.
Package semaphore provides a weighted semaphore implementation.
internal/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
examples

Jump to

Keyboard shortcuts

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