2023-06-29 17:49:12 +02:00
|
|
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2023-07-07 15:42:04 +02:00
|
|
|
package org.pgpainless.wot.api
|
2023-06-29 17:49:12 +02:00
|
|
|
|
2023-07-09 13:03:57 +02:00
|
|
|
import org.pgpainless.wot.network.Fingerprint
|
2023-07-11 14:39:37 +02:00
|
|
|
import org.pgpainless.wot.network.Node
|
2023-07-09 13:03:57 +02:00
|
|
|
import org.pgpainless.wot.query.Paths
|
2023-07-03 17:07:21 +02:00
|
|
|
|
2023-07-03 20:11:01 +02:00
|
|
|
interface IdentifyAPI {
|
|
|
|
|
|
|
|
fun identify(arguments: Arguments): Result
|
|
|
|
|
|
|
|
data class Arguments(val fingerprint: Fingerprint)
|
|
|
|
|
2023-07-13 16:53:35 +02:00
|
|
|
data class Result(val bindings: List<Binding>, val targetAmount: Int) {
|
|
|
|
val acceptable: Boolean
|
|
|
|
get() = bindings.any {
|
|
|
|
it.paths.amount >= targetAmount
|
|
|
|
}
|
|
|
|
}
|
2023-07-03 17:07:21 +02:00
|
|
|
}
|