Skip to main content

Mesh Discovery (Insight)

Package: com.mimik.mimoe.insight

Device mesh discovery and networking.

InsightClient

class InsightClient

Insight (mesh discovery) sub-client.

Provides node discovery via link-local, account, and proximity methods. Base path: /mimik-mesh/insight/v1 Requires the mesh-foundation addon.

Access via client.insight.

Functions

discoverByAccount

suspend fun discoverByAccount(): Result<List<NodeInfo>>

Discover nodes associated with the same account.

discoverByProximity

suspend fun discoverByProximity(): Result<List<NodeInfo>>

Discover nodes by proximity.

discoverLinkLocal

suspend fun discoverLinkLocal(): Result<List<NodeInfo>>

Discover nodes on the local network.

getSelf

suspend fun getSelf(): Result<NodeInfo>

Get information about the current node.

storeToken

suspend fun storeToken(token: String, expiresAt: Long? = null): Result<Unit>

Store a JWT for account-scoped operations.


NodeAddress

@Serializable
data class NodeAddress(
val type: String = "",
val url: NodeUrl = NodeUrl()
)

A network address for a node.

Constructors

constructor(type: String = "", url: NodeUrl = NodeUrl())

Properties

NameSummary
typeval type: String
Address type classification.
urlval url: NodeUrl
URL containing the endpoint href.

NodeInfo

@Serializable
data class NodeInfo(
val id: String,
val accountId: String? = null,
val name: String = "",
val os: String = "",
val addresses: List<NodeAddress> = emptyList(),
val services: List<NodeService> = emptyList()
)

Information about a discovered node.

Fields match the Insight API response from GET /mimik-mesh/insight/v1/nodes and GET /mimik-mesh/insight/v1/info?types=self.

Constructors

constructor(
id: String,
accountId: String? = null,
name: String = "",
os: String = "",
addresses: List<NodeAddress> = emptyList(),
services: List<NodeService> = emptyList()
)

Properties

NameSummary
accountIdval accountId: String? = null
Associated account ID.
addressesval addresses: List<NodeAddress>
Network addresses.
idval id: String
Node unique identifier.
nameval name: String
Human-readable node name.
osval os: String
Operating system (e.g., "android", "ios").
servicesval services: List<NodeService>
Deployed services on this node.

NodeService

@Serializable
data class NodeService(
val id: String = "",
val serviceType: String = "",
val version: String = "",
val status: String = "",
val tenant: String = ""
)

A service deployed on a node.

Constructors

constructor(
id: String = "",
serviceType: String = "",
version: String = "",
status: String = "",
tenant: String = ""
)

Properties

NameSummary
idval id: String
Service identifier.
serviceTypeval serviceType: String
Service/mim image name.
statusval status: String
Current status (e.g., "running").
tenantval tenant: String
Tenant identifier.
versionval version: String
Service version.

NodeUrl

@Serializable
data class NodeUrl(val href: String = "")

Constructors

constructor(href: String = "")

Properties

NameSummary
hrefval href: String
Full endpoint URL.