pub struct Config {
pub api_keys: Vec<String>,
pub public_url: Option<String>,
pub max_batch_concurrency: Option<usize>,
pub store: Option<Store>,
pub key_limits: HashMap<String, KeyLimits>,
pub default_limits: KeyLimits,
pub webhook: WebhookSettings,
pub timeouts: Timeouts,
pub ledger: Option<Arc<Ledger>>,
pub job_mirror: Option<Arc<JobMirror>>,
pub extra_metrics: Option<ExtraMetrics>,
pub monitor_leader: Option<Leader>,
}Fields§
§api_keys: Vec<String>When empty, authentication is disabled; otherwise requires Authorization: Bearer <key>.
public_url: Option<String>Public URL for building absolute resource links.
max_batch_concurrency: Option<usize>§store: Option<Store>Persistent store for jobs and resume capability.
key_limits: HashMap<String, KeyLimits>Per-key custom limits.
default_limits: KeyLimitsDefault limits applied to other keys or unauthenticated callers.
webhook: WebhookSettings§timeouts: Timeouts请求体和整请求超时;请求头超时由 serve_with 的参数决定。
ledger: Option<Arc<Ledger>>多服务器网关:配额和每分钟请求数记在账本里(追加记录,崩溃重放、温备回放后一致)。 单主机不设,照旧用本进程的令牌桶和存储里的当天用量。
job_mirror: Option<Arc<JobMirror>>多服务器网关:任务存储的写入复制到温备(crate::JobMirror)。单主机不设。
extra_metrics: Option<ExtraMetrics>追加在 /metrics 后面的指标(多服务器网关:按工人加标签的统计)。
monitor_leader: Option<Leader>监控调度者:多服务器时只有持有网关租约的机器调度(返回真才检查)。单主机不设,总是调度。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Config
impl !UnwindSafe for Config
impl Freeze for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more