youtu_grpc/pkg/id_gen/sonyflake.go
xiabin 90f1d6eecf
Some checks failed
Auth & User Management Service CI / build-services (app/auth_service/Dockerfile, auth_service, auth_service) (push) Has been cancelled
Auth & User Management Service CI / build-services (app/douyin_ecpm_calculation_service/Dockerfile, douyin_ecpm_calculation_service, douyin_ecpm_calculation_service) (push) Has been cancelled
Auth & User Management Service CI / build-services (app/ranking_management/Dockerfile, ranking_management, ranking_management) (push) Has been cancelled
Auth & User Management Service CI / build-services (app/user_management/Dockerfile, user_manager, user_management) (push) Has been cancelled
Auth & User Management Service CI / start-services (push) Has been cancelled
各服务数据库逻辑拆分
更新用户id为Sonyflake

添加gitea actions(ci/cd)

配置文件读取方式改为从ETCD读取

修改go module名称与gitea一致
2025-02-11 18:31:28 +08:00

17 lines
440 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package id_gen
import (
"github.com/sony/sonyflake"
"time"
)
var st = time.Date(2025, 2, 8, 0, 0, 0, 0, time.UTC)
func New() (cli *sonyflake.Sonyflake) {
return sonyflake.NewSonyflake(sonyflake.Settings{
StartTime: st, //开始时间,早于当前时间,固定值
MachineID: nil, //获取MachineID的函数为空使用默认值
CheckMachineID: nil, //获取CheckMachineID的函数为空使用默认值
})
}