MCPcopy Create free account
hub / github.com/BigBoot/AutoKuma / create_entity_selector

Method create_entity_selector

autokuma/src/sync.rs:184–202  ·  view source on GitHub ↗
(name: String, entity: &Entity)

Source from the content-addressed store, hash-verified

182 }
183
184 fn create_entity_selector(name: String, entity: &Entity) -> Result<Option<EntitySelector>> {
185 Ok(match entity {
186 Entity::Monitor(monitor) => monitor
187 .common()
188 .id()
189 .map(|id| EntitySelector::Monitor(name, id)),
190 Entity::DockerHost(docker_host) => docker_host
191 .id
192 .map(|id| EntitySelector::DockerHost(name, id)),
193 Entity::Notification(notification) => notification
194 .id
195 .map(|id| EntitySelector::Notification(name, id)),
196 Entity::Tag(tag) => tag.tag_id.map(|id| EntitySelector::Tag(name, id)),
197 Entity::StatusPage(status_page) => status_page
198 .slug
199 .as_ref()
200 .map(|id| EntitySelector::StatusPage(name, id.clone())),
201 })
202 }
203
204 async fn get_connection(&mut self) -> Result<Arc<Client>> {
205 if self.client.is_none() {

Callers

nothing calls this directly

Calls 6

MonitorEnum · 0.85
DockerHostClass · 0.85
NotificationClass · 0.85
TagClass · 0.85
StatusPageClass · 0.85
commonMethod · 0.45

Tested by

no test coverage detected