<commit_before>package main

import (
    "reflect"
    "fmt"
    "unsafe"
    "time"
    "github.com/BluePecker/JwtAuth/storage"
    _ "github.com/BluePecker/JwtAuth/storage/redis"
)

type Hand struct {
    
}

type Foot struct {
    K string
}

func (f *Foot) Hi() {
    fmt.Println("fh")
}

type User struct {
    Name string
    //Hand *Hand
    Foot *Foot
}

func (u *User) Ec() string {
    fmt.Println("ec")
    return "ec"
}

type G struct {
    Name string
}

func (g *G) E() {
    *g = G{
        Name: "shuc",
    }
}

func main() {
    user := &User{
        Name: "SC",
    }
    
    fmt.Printf("测试: %+v", (*struct {
        Ne  string
        Age int
        H   int
    })(unsafe.Pointer(user)))
    
    fmt.Println(reflect.ValueOf(*user).FieldByName("Foot"))
    
    fmt.Println(reflect.New(reflect.ValueOf(*user).Type()))
    
    redis, err := storage.NewManager("redis", storage.Options{
        Host: "127.0.0.1",
        Port: 6379,
        PoolSize: 20,
    });
    
    if err != nil {
        fmt.Println(err)
    }
    
    redis.Write("jwt", "13658009009", 0)
    redis.Write("auth", "13658009009", 30)
    
    //fmt.Println("redis ttl: ", redis.TTL("jwt"))
    //fmt.Println("redis ttl: ", redis.TTL("auth"))
    //v, err := redis.ReadString("jwt")
    //fmt.Println("redis ttl: ", v, err)
    //v, err = redis.ReadString("auth")
    //fmt.Println("redis ttl: ", v, err)<commit_msg>redis driver<commit_after>package main

import (
    "reflect"
    "fmt"
    "unsafe"
    "time"
    "github.com/BluePecker/JwtAuth/storage"
    _ "github.com/BluePecker/JwtAuth/storage/redis"
)

type Hand struct {
    
}

type Foot struct {
    K string
}

func (f *Foot) Hi() {
    fmt.Println("fh")
}

type User struct {
    Name string
    //Hand *Hand
    Foot *Foot
}

func (u *User) Ec() string {
    fmt.Println("ec")
    return "ec"
}

type G struct {
    Name string
}

func (g *G) E() {
    *g = G{
        Name: "shuc",
    }
}

func main() {
    user := &User{
        Name: "SC",
    }
    
    fmt.Printf("测试: %+v", (*struct {
        Ne  string
        Age int
        H   int
    })(unsafe.Pointer(user)))
    
    fmt.Println(reflect.ValueOf(*user).FieldByName("Foot"))
    
    fmt.Println(reflect.New(reflect.ValueOf(*user).Type()))
    
    redis, err := storage.NewManager("redis", storage.Options{
        Host: "127.0.0.1",
        Port: 6379,
        PoolSize: 20,
    });
    
    if err != nil {
        fmt.Println(err)
    }
    
    redis.Write("jwt", "13658009009", 0)
    redis.Write("auth", "13658009009", 30)
    
    fmt.Println("redis ttl: ", redis.TTL("jwt"))
    fmt.Println("redis ttl: ", redis.TTL("auth"))
    v, err := redis.ReadString("jwt")
    fmt.Println("redis ttl: ", v, err)
    v, err = redis.ReadString("auth")
    fmt.Println("redis ttl: ", v, err)
{'fraction_non_alphanumeric': 0.1741912548880199, 'fraction_numerical': 0.02630643441166015, 'mean_word_length': 2.140625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5403230', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1089, 'n_words': 220}