1
0
mirror of synced 2026-02-22 21:07:55 +08:00

autocommit

This commit is contained in:
yitter
2021-04-06 00:18:12 +08:00
parent a15315fb58
commit b87af2e8de
16 changed files with 37 additions and 61 deletions

16
Rust/source/Cargo.lock generated
View File

@@ -19,6 +19,14 @@ dependencies = [
"winapi",
]
[[package]]
name = "idgen"
version = "1.0.0"
dependencies = [
"chrono",
"libc",
]
[[package]]
name = "libc"
version = "0.2.90"
@@ -82,11 +90,3 @@ name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "yitter_idgen"
version = "1.0.0"
dependencies = [
"chrono",
"libc",
]

View File

@@ -1,5 +1,5 @@
[package]
name = "yitter_idgen"
name = "idgen"
version = "1.0.0"
authors = ["yitter <yitter@126.com>"]
edition = "2018"
@@ -13,10 +13,10 @@ keywords = ["snowflake", "idgenerator"]
[dependencies]
libc = "*"
chrono = "0.4.10"
chrono = "0.4"
#lazy_static = "1.4.0"
[lib]
name = "yitter_idgen"
name = "idgen"
path = "./src/lib.rs"
crate-type = ["cdylib"]

View File

@@ -5,12 +5,10 @@
use std::{thread, time};
use std::net::UdpSocket;
use chrono::Utc;
use super::super::contract::*;
use super::super::core::*;
use super::*;
use std::sync::Mutex;
use std::sync::Arc;
use std::borrow::BorrowMut;
use crate::idgen::*;
// static mut instance2: Option<Arc<Mutex<SnowWorkerM1>>> = None;

View File

@@ -0,0 +1,18 @@
mod default_id_generator;
mod yit_id_helper;
mod snow_worker_m1;
mod snow_worker_m2;
mod id_generator_options;
mod i_snow_worker;
mod over_cost_action_arg;
use snow_worker_m1::SnowWorkerM1;
use snow_worker_m2::SnowWorkerM2;
pub use over_cost_action_arg::OverCostActionArg;
pub use yit_id_helper::YitIdHelper;
pub use default_id_generator::DefaultIdGenerator;
pub use id_generator_options::IdGeneratorOptions;
pub use i_snow_worker::ISnowWorker;

View File

@@ -2,10 +2,10 @@
* yitter(yitter@126.com)
* https://gitee.com/yitter/idgenerator
*/
use super::super::contract::*;
use std::{thread};
use chrono::Utc;
use std::thread::sleep;
use crate::idgen::*;
// use lazy_static::lazy_static;
pub struct SnowWorkerM1 {

View File

@@ -2,7 +2,7 @@
* yitter(yitter@126.com)
* https://gitee.com/yitter/idgenerator
*/
use super::super::contract::ISnowWorker;
use crate::idgen::*;
pub struct SnowWorkerM2 {

View File

@@ -2,11 +2,9 @@
* yitter(yitter@126.com)
* https://gitee.com/yitter/idgenerator
*/
use super::super::contract::*;
use super::super::core::*;
use super::*;
use std::sync::Mutex;
use std::sync::Arc;
use crate::idgen::*;
pub struct YitIdHelper;

View File

@@ -1,7 +1,4 @@
mod yitgen;
use yitgen::gen::YitIdHelper;
use yitgen::contract::*;
mod idgen;
#[macro_use]
// extern crate lazy_static;
@@ -12,6 +9,7 @@ extern crate libc;
use libc::{c_char, uint32_t};
use std::ffi::{CStr, CString};
use std::str;
pub use idgen::*;
// lazy_static! {
// static ref TestValue: Vec<i32> = vec!(0);

View File

@@ -1,7 +1,6 @@
mod yitgen;
mod idgen;
use yitgen::contract::*;
use yitgen::gen::*;
use idgen::*;
use std::thread;
use chrono::Utc;
use std::time::Duration;

View File

@@ -1,13 +0,0 @@
/*
* 版权属于yitter(yitter@126.com)
* 开源地址https://gitee.com/yitter/idgenerator
*/
mod id_generator_options;
mod i_snow_worker;
mod over_cost_action_arg;
pub use id_generator_options::IdGeneratorOptions;
pub use i_snow_worker::ISnowWorker;
pub use over_cost_action_arg::OverCostActionArg;

View File

@@ -1,10 +0,0 @@
/*
* 版权属于yitter(yitter@126.com)
* 开源地址https://gitee.com/yitter/idgenerator
*/
mod snow_worker_m1;
mod snow_worker_m2;
pub use snow_worker_m1::SnowWorkerM1;
pub use snow_worker_m2::SnowWorkerM2;

View File

@@ -1,9 +0,0 @@
/*
* 版权属于yitter(yitter@126.com)
* 开源地址https://gitee.com/yitter/idgenerator
*/
mod default_id_generator;
mod yit_id_helper;
pub use yit_id_helper::YitIdHelper;
pub use default_id_generator::DefaultIdGenerator;

View File

@@ -1,3 +0,0 @@
pub mod contract;
pub mod core;
pub mod gen;