#kubernetes #api-server #api-bindings

yanked status_manager

Kubernetes apiserver

1 unstable release

0.0.1 Nov 1, 2024

#64 in #k8s

Download history 107/week @ 2024-10-26 27/week @ 2024-11-02 1/week @ 2024-11-09

135 downloads per month

Apache-2.0

24KB
394 lines

status-manager

介绍

提供。

使用说明

添加依赖

cargo add status_manager

示例代码

use std::env;
use diesel::pg::PgConnection;
use diesel::{update, Connection, ConnectionError};
use diesel::dsl::delete;
use status_manager::cores::create::create_posgres_table;
use crate::cores::create::{create_sqlite3_table, insert_postgres_object, insert_sqlite3_object};
use crate::cores::delete::{delete_postgres_object, delete_sqlite3_object, drop_postgres_table, drop_sqlite3_table};
use crate::cores::query::{list_postgres_object, list_sqlite3_object, query_postgres_table, query_sqlite3_table};
use serde_json::json;
use crate::cores::update::{update_postgres_object, update_sqlite3_object};
use std::collections::HashMap;
use diesel::SqliteConnection;

static SQLITE3_URL: &str =  "/data/database.db";

fn main()
{

    match establish_sqlite3_connection() {
        Ok(mut conn) => {
            println!("connecting successfully.");
        },
        Err(e) => {
            eprintln!("Error connecting to the database: {}", e);
        },
    }
}

fn establish_sqlite3_connection() -> Result<SqliteConnection, ConnectionError> {
    SqliteConnection::establish(SQLITE3_URL)
}

效果验证

Dependencies

~31MB
~513K SLoC