// Copyright 2024 RustFS Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/// A list of all valid configuration keys for a Redis target.
pub const NOTIFY_REDIS_KEYS: &[&str] = &[
    crate::ENABLE_KEY,
    crate::REDIS_URL,
    crate::REDIS_CHANNEL,
    crate::REDIS_USERNAME,
    crate::REDIS_PASSWORD,
    crate::REDIS_KEEP_ALIVE_INTERVAL,
    crate::REDIS_QUEUE_DIR,
    crate::REDIS_QUEUE_LIMIT,
    crate::REDIS_MAX_RETRY_ATTEMPTS,
    crate::REDIS_RECONNECT_RETRY_ATTEMPTS,
    crate::REDIS_MIN_RETRY_DELAY,
    crate::REDIS_MAX_RETRY_DELAY,
    crate::REDIS_CONNECTION_TIMEOUT,
    crate::REDIS_RESPONSE_TIMEOUT,
    crate::REDIS_PIPELINE_BUFFER_SIZE,
    crate::REDIS_TLS_POLICY,
    crate::REDIS_TLS_CA,
    crate::REDIS_TLS_CLIENT_CERT,
    crate::REDIS_TLS_CLIENT_KEY,
    crate::REDIS_TLS_ALLOW_INSECURE,
    crate::COMMENT_KEY,
];

pub const ENV_NOTIFY_REDIS_ENABLE: &str = "RUSTFS_NOTIFY_REDIS_ENABLE";
pub const ENV_NOTIFY_REDIS_URL: &str = "RUSTFS_NOTIFY_REDIS_URL";
pub const ENV_NOTIFY_REDIS_CHANNEL: &str = "RUSTFS_NOTIFY_REDIS_CHANNEL";
pub const ENV_NOTIFY_REDIS_USERNAME: &str = "RUSTFS_NOTIFY_REDIS_USERNAME";
pub const ENV_NOTIFY_REDIS_PASSWORD: &str = "RUSTFS_NOTIFY_REDIS_PASSWORD";
pub const ENV_NOTIFY_REDIS_KEEP_ALIVE_INTERVAL: &str = "RUSTFS_NOTIFY_REDIS_KEEP_ALIVE_INTERVAL";
pub const ENV_NOTIFY_REDIS_QUEUE_DIR: &str = "RUSTFS_NOTIFY_REDIS_QUEUE_DIR";
pub const ENV_NOTIFY_REDIS_QUEUE_LIMIT: &str = "RUSTFS_NOTIFY_REDIS_QUEUE_LIMIT";
pub const ENV_NOTIFY_REDIS_MAX_RETRY_ATTEMPTS: &str = "RUSTFS_NOTIFY_REDIS_MAX_RETRY_ATTEMPTS";
pub const ENV_NOTIFY_REDIS_RECONNECT_RETRY_ATTEMPTS: &str = "RUSTFS_NOTIFY_REDIS_RECONNECT_RETRY_ATTEMPTS";
pub const ENV_NOTIFY_REDIS_MIN_RETRY_DELAY: &str = "RUSTFS_NOTIFY_REDIS_MIN_RETRY_DELAY";
pub const ENV_NOTIFY_REDIS_MAX_RETRY_DELAY: &str = "RUSTFS_NOTIFY_REDIS_MAX_RETRY_DELAY";
pub const ENV_NOTIFY_REDIS_CONNECTION_TIMEOUT: &str = "RUSTFS_NOTIFY_REDIS_CONNECTION_TIMEOUT";
pub const ENV_NOTIFY_REDIS_RESPONSE_TIMEOUT: &str = "RUSTFS_NOTIFY_REDIS_RESPONSE_TIMEOUT";
pub const ENV_NOTIFY_REDIS_PIPELINE_BUFFER_SIZE: &str = "RUSTFS_NOTIFY_REDIS_PIPELINE_BUFFER_SIZE";
pub const ENV_NOTIFY_REDIS_TLS_POLICY: &str = "RUSTFS_NOTIFY_REDIS_TLS_POLICY";
pub const ENV_NOTIFY_REDIS_TLS_CA: &str = "RUSTFS_NOTIFY_REDIS_TLS_CA";
pub const ENV_NOTIFY_REDIS_TLS_CLIENT_CERT: &str = "RUSTFS_NOTIFY_REDIS_TLS_CLIENT_CERT";
pub const ENV_NOTIFY_REDIS_TLS_CLIENT_KEY: &str = "RUSTFS_NOTIFY_REDIS_TLS_CLIENT_KEY";
pub const ENV_NOTIFY_REDIS_TLS_ALLOW_INSECURE: &str = "RUSTFS_NOTIFY_REDIS_TLS_ALLOW_INSECURE";

pub const ENV_NOTIFY_REDIS_KEYS: &[&str; 20] = &[
    ENV_NOTIFY_REDIS_ENABLE,
    ENV_NOTIFY_REDIS_URL,
    ENV_NOTIFY_REDIS_CHANNEL,
    ENV_NOTIFY_REDIS_USERNAME,
    ENV_NOTIFY_REDIS_PASSWORD,
    ENV_NOTIFY_REDIS_KEEP_ALIVE_INTERVAL,
    ENV_NOTIFY_REDIS_QUEUE_DIR,
    ENV_NOTIFY_REDIS_QUEUE_LIMIT,
    ENV_NOTIFY_REDIS_MAX_RETRY_ATTEMPTS,
    ENV_NOTIFY_REDIS_RECONNECT_RETRY_ATTEMPTS,
    ENV_NOTIFY_REDIS_MIN_RETRY_DELAY,
    ENV_NOTIFY_REDIS_MAX_RETRY_DELAY,
    ENV_NOTIFY_REDIS_CONNECTION_TIMEOUT,
    ENV_NOTIFY_REDIS_RESPONSE_TIMEOUT,
    ENV_NOTIFY_REDIS_PIPELINE_BUFFER_SIZE,
    ENV_NOTIFY_REDIS_TLS_POLICY,
    ENV_NOTIFY_REDIS_TLS_CA,
    ENV_NOTIFY_REDIS_TLS_CLIENT_CERT,
    ENV_NOTIFY_REDIS_TLS_CLIENT_KEY,
    ENV_NOTIFY_REDIS_TLS_ALLOW_INSECURE,
];
