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,
}Fields§
§api_keys: Vec<String>为空时不鉴权;否则要求 Authorization: Bearer <key>。
public_url: Option<String>对外地址,用来生成任务的绝对 URL 和分页的 next;不设时用请求的 Host 头。
max_batch_concurrency: Option<usize>§store: Option<Store>任务落盘用的存储:重启后结束的任务照样能查,进行中的从断点继续。 不设时任务只在内存里。
key_limits: HashMap<String, KeyLimits>单独设了限额的 API key(它们也是有效的 key)。
default_limits: KeyLimits其余 key 的限额;不鉴权时所有调用方合用这一份。默认不限。
webhook: WebhookSettingsTrait 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