brokkr-broker::dal Rust
Structs
brokkr-broker::dal::DAL
pub
Derives: Clone
The main Data Access Layer struct.
This struct serves as the central point for database operations, managing a connection pool and providing access to specific DAL implementations for different entities.
Fields
| Name | Type | Description |
|---|---|---|
pool | ConnectionPool | A connection pool for PostgreSQL database connections with schema support. |
auth_cache | Option < Cache < String , AuthPayload > > | In-memory cache for PAK authentication results, keyed by PAK hash. |
Methods
new pub
#![allow(unused)]
fn main() {
fn new (pool : ConnectionPool) -> Self
}
Creates a new DAL instance with the given connection pool.
Parameters:
| Name | Type | Description |
|---|---|---|
pool | - | A connection pool for PostgreSQL database connections with schema support. |
Returns:
A new DAL instance.
Source
#![allow(unused)]
fn main() {
pub fn new(pool: ConnectionPool) -> Self {
DAL {
pool,
auth_cache: None,
}
}
}
new_with_auth_cache pub
#![allow(unused)]
fn main() {
fn new_with_auth_cache (pool : ConnectionPool , auth_cache_ttl_seconds : u64) -> Self
}
Creates a new DAL instance with an auth cache.
Parameters:
| Name | Type | Description |
|---|---|---|
pool | - | A connection pool for PostgreSQL database connections with schema support. |
auth_cache_ttl_seconds | - | TTL for cached auth results. 0 disables caching. |
Source
#![allow(unused)]
fn main() {
pub fn new_with_auth_cache(pool: ConnectionPool, auth_cache_ttl_seconds: u64) -> Self {
let auth_cache = if auth_cache_ttl_seconds > 0 {
Some(
Cache::builder()
.time_to_live(Duration::from_secs(auth_cache_ttl_seconds))
.max_capacity(10_000)
.build(),
)
} else {
None
};
DAL { pool, auth_cache }
}
}
invalidate_auth_cache pub
#![allow(unused)]
fn main() {
fn invalidate_auth_cache (& self , pak_hash : & str)
}
Invalidates a specific entry in the auth cache by PAK hash.
Source
#![allow(unused)]
fn main() {
pub fn invalidate_auth_cache(&self, pak_hash: &str) {
if let Some(cache) = &self.auth_cache {
cache.invalidate(pak_hash);
}
}
}
invalidate_all_auth_cache pub
#![allow(unused)]
fn main() {
fn invalidate_all_auth_cache (& self)
}
Invalidates all entries in the auth cache.
Source
#![allow(unused)]
fn main() {
pub fn invalidate_all_auth_cache(&self) {
if let Some(cache) = &self.auth_cache {
cache.invalidate_all();
}
}
}
agents pub
#![allow(unused)]
fn main() {
fn agents (& self) -> AgentsDAL < '_ >
}
Provides access to the Agents Data Access Layer.
Returns:
An instance of AgentsDAL.
Source
#![allow(unused)]
fn main() {
pub fn agents(&self) -> AgentsDAL<'_> {
AgentsDAL { dal: self }
}
}
agent_annotations pub
#![allow(unused)]
fn main() {
fn agent_annotations (& self) -> AgentAnnotationsDAL < '_ >
}
Provides access to the Agent Annotations Data Access Layer.
Returns:
An instance of AgentAnontationsDAL.
Source
#![allow(unused)]
fn main() {
pub fn agent_annotations(&self) -> AgentAnnotationsDAL<'_> {
AgentAnnotationsDAL { dal: self }
}
}
agent_events pub
#![allow(unused)]
fn main() {
fn agent_events (& self) -> AgentEventsDAL < '_ >
}
Provides access to the Agent Events Data Access Layer.
Returns:
An instance of AgentEventsDAL.
Source
#![allow(unused)]
fn main() {
pub fn agent_events(&self) -> AgentEventsDAL<'_> {
AgentEventsDAL { dal: self }
}
}
agent_labels pub
#![allow(unused)]
fn main() {
fn agent_labels (& self) -> AgentLabelsDAL < '_ >
}
Provides access to the Agent Labels Data Access Layer.
Returns:
An instance of AgentLabelsDAL.
Source
#![allow(unused)]
fn main() {
pub fn agent_labels(&self) -> AgentLabelsDAL<'_> {
AgentLabelsDAL { dal: self }
}
}
agent_targets pub
#![allow(unused)]
fn main() {
fn agent_targets (& self) -> AgentTargetsDAL < '_ >
}
Provides access to the Agent Targets Data Access Layer.
Returns:
An instance of AgentTargetssDAL.
Source
#![allow(unused)]
fn main() {
pub fn agent_targets(&self) -> AgentTargetsDAL<'_> {
AgentTargetsDAL { dal: self }
}
}
stack_labels pub
#![allow(unused)]
fn main() {
fn stack_labels (& self) -> StackLabelsDAL < '_ >
}
Provides access to the Stack Labels Data Access Layer.
Returns:
An instance of StackLabelsDAL.
Source
#![allow(unused)]
fn main() {
pub fn stack_labels(&self) -> StackLabelsDAL<'_> {
StackLabelsDAL { dal: self }
}
}
stack_annotations pub
#![allow(unused)]
fn main() {
fn stack_annotations (& self) -> StackAnnotationsDAL < '_ >
}
Provides access to the Stack Annotations Data Access Layer.
Returns:
An instance of StackAnontationsDAL.
Source
#![allow(unused)]
fn main() {
pub fn stack_annotations(&self) -> StackAnnotationsDAL<'_> {
StackAnnotationsDAL { dal: self }
}
}
stacks pub
#![allow(unused)]
fn main() {
fn stacks (& self) -> StacksDAL < '_ >
}
Provides access to the Stacks Data Access Layer.
Returns:
An instance of StacksDAL.
Source
#![allow(unused)]
fn main() {
pub fn stacks(&self) -> StacksDAL<'_> {
StacksDAL { dal: self }
}
}
deployment_health pub
#![allow(unused)]
fn main() {
fn deployment_health (& self) -> DeploymentHealthDAL < '_ >
}
Provides access to the Deployment Health Data Access Layer.
Returns:
An instance of DeploymentHealthDAL.
Source
#![allow(unused)]
fn main() {
pub fn deployment_health(&self) -> DeploymentHealthDAL<'_> {
DeploymentHealthDAL { dal: self }
}
}
deployment_objects pub
#![allow(unused)]
fn main() {
fn deployment_objects (& self) -> DeploymentObjectsDAL < '_ >
}
Provides access to the Deployment Objects Data Access Layer.
Returns:
An instance of DeploymentObjectsDAL.
Source
#![allow(unused)]
fn main() {
pub fn deployment_objects(&self) -> DeploymentObjectsDAL<'_> {
DeploymentObjectsDAL { dal: self }
}
}
generators pub
#![allow(unused)]
fn main() {
fn generators (& self) -> GeneratorsDAL < '_ >
}
Provides access to the Generators Data Access Layer.
Returns:
An instance of GeneratorsDal.
Source
#![allow(unused)]
fn main() {
pub fn generators(&self) -> GeneratorsDAL<'_> {
GeneratorsDAL { dal: self }
}
}
templates pub
#![allow(unused)]
fn main() {
fn templates (& self) -> TemplatesDAL < '_ >
}
Provides access to the Templates Data Access Layer.
Returns:
An instance of TemplatesDAL.
Source
#![allow(unused)]
fn main() {
pub fn templates(&self) -> TemplatesDAL<'_> {
TemplatesDAL { dal: self }
}
}
template_labels pub
#![allow(unused)]
fn main() {
fn template_labels (& self) -> TemplateLabelsDAL < '_ >
}
Provides access to the Template Labels Data Access Layer.
Returns:
An instance of TemplateLabelsDAL.
Source
#![allow(unused)]
fn main() {
pub fn template_labels(&self) -> TemplateLabelsDAL<'_> {
TemplateLabelsDAL { dal: self }
}
}
template_annotations pub
#![allow(unused)]
fn main() {
fn template_annotations (& self) -> TemplateAnnotationsDAL < '_ >
}
Provides access to the Template Annotations Data Access Layer.
Returns:
An instance of TemplateAnnotationsDAL.
Source
#![allow(unused)]
fn main() {
pub fn template_annotations(&self) -> TemplateAnnotationsDAL<'_> {
TemplateAnnotationsDAL { dal: self }
}
}
template_targets pub
#![allow(unused)]
fn main() {
fn template_targets (& self) -> TemplateTargetsDAL < '_ >
}
Provides access to the Template Targets Data Access Layer.
Returns:
An instance of TemplateTargetsDAL.
Source
#![allow(unused)]
fn main() {
pub fn template_targets(&self) -> TemplateTargetsDAL<'_> {
TemplateTargetsDAL { dal: self }
}
}
rendered_deployment_objects pub
#![allow(unused)]
fn main() {
fn rendered_deployment_objects (& self) -> RenderedDeploymentObjectsDAL < '_ >
}
Provides access to the Rendered Deployment Objects Data Access Layer.
Returns:
An instance of RenderedDeploymentObjectsDAL.
Source
#![allow(unused)]
fn main() {
pub fn rendered_deployment_objects(&self) -> RenderedDeploymentObjectsDAL<'_> {
RenderedDeploymentObjectsDAL { dal: self }
}
}
work_orders pub
#![allow(unused)]
fn main() {
fn work_orders (& self) -> WorkOrdersDAL < '_ >
}
Provides access to the Work Orders Data Access Layer.
Returns:
An instance of WorkOrdersDAL.
Source
#![allow(unused)]
fn main() {
pub fn work_orders(&self) -> WorkOrdersDAL<'_> {
WorkOrdersDAL { dal: self }
}
}
diagnostic_requests pub
#![allow(unused)]
fn main() {
fn diagnostic_requests (& self) -> DiagnosticRequestsDAL < '_ >
}
Provides access to the Diagnostic Requests Data Access Layer.
Returns:
An instance of DiagnosticRequestsDAL.
Source
#![allow(unused)]
fn main() {
pub fn diagnostic_requests(&self) -> DiagnosticRequestsDAL<'_> {
DiagnosticRequestsDAL { dal: self }
}
}
diagnostic_results pub
#![allow(unused)]
fn main() {
fn diagnostic_results (& self) -> DiagnosticResultsDAL < '_ >
}
Provides access to the Diagnostic Results Data Access Layer.
Returns:
An instance of DiagnosticResultsDAL.
Source
#![allow(unused)]
fn main() {
pub fn diagnostic_results(&self) -> DiagnosticResultsDAL<'_> {
DiagnosticResultsDAL { dal: self }
}
}
webhook_subscriptions pub
#![allow(unused)]
fn main() {
fn webhook_subscriptions (& self) -> WebhookSubscriptionsDAL < '_ >
}
Provides access to the Webhook Subscriptions Data Access Layer.
Returns:
An instance of WebhookSubscriptionsDAL.
Source
#![allow(unused)]
fn main() {
pub fn webhook_subscriptions(&self) -> WebhookSubscriptionsDAL<'_> {
WebhookSubscriptionsDAL { dal: self }
}
}
webhook_deliveries pub
#![allow(unused)]
fn main() {
fn webhook_deliveries (& self) -> WebhookDeliveriesDAL < '_ >
}
Provides access to the Webhook Deliveries Data Access Layer.
Returns:
An instance of WebhookDeliveriesDAL.
Source
#![allow(unused)]
fn main() {
pub fn webhook_deliveries(&self) -> WebhookDeliveriesDAL<'_> {
WebhookDeliveriesDAL { dal: self }
}
}
audit_logs pub
#![allow(unused)]
fn main() {
fn audit_logs (& self) -> AuditLogsDAL < '_ >
}
Provides access to the Audit Logs Data Access Layer.
Returns:
An instance of AuditLogsDAL.
Source
#![allow(unused)]
fn main() {
pub fn audit_logs(&self) -> AuditLogsDAL<'_> {
AuditLogsDAL { dal: self }
}
}
Enums
brokkr-broker::dal::DalError pub
Error types for DAL operations.
Variants
ConnectionPool- Failed to get a connection from the poolQuery- Database query errorNotFound- Resource not found
brokkr-broker::dal::FilterType pub
Variants
AndOr