wip: jwt
This commit is contained in:
@ -2,8 +2,6 @@ package tool
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"gitea.loveuer.com/yizhisec/packages/opt"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -23,7 +21,7 @@ func Timeout(seconds ...int) (ctx context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
func CtxTimeout(ctx context.Context, seconds ...int) context.Context {
|
||||
func TimeoutCtx(ctx context.Context, seconds ...int) context.Context {
|
||||
var (
|
||||
duration time.Duration
|
||||
)
|
||||
@ -38,7 +36,3 @@ func CtxTimeout(ctx context.Context, seconds ...int) context.Context {
|
||||
|
||||
return nctx
|
||||
}
|
||||
|
||||
func CtxTrace(ctx context.Context, key string) context.Context {
|
||||
return context.WithValue(ctx, opt.TraceKey, fmt.Sprintf("%36s", key))
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
package tool
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func Local(c *gin.Context, key string) any {
|
||||
data, ok := c.Get(key)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
@ -2,7 +2,7 @@ package tool
|
||||
|
||||
import (
|
||||
"context"
|
||||
"gitea.loveuer.com/yizhisec/packages/logger"
|
||||
"loveuer/utodo/pkg/logger"
|
||||
"sync"
|
||||
)
|
||||
|
||||
|
@ -5,11 +5,12 @@ import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gitea.loveuer.com/yizhisec/packages/logger"
|
||||
"golang.org/x/crypto/pbkdf2"
|
||||
"loveuer/utodo/pkg/logger"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/crypto/pbkdf2"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,12 +3,13 @@ package tool
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"gitea.loveuer.com/yizhisec/packages/logger"
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
"io"
|
||||
"loveuer/utodo/pkg/logger"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
)
|
||||
|
||||
func TablePrinter(data any, writers ...io.Writer) {
|
||||
|
Reference in New Issue
Block a user