blob: e703b3568179022c829fb448aaad4401ec855737 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
module mojo.bindings.types;
//module v23proxy; // TODO(bprosnitz) Ideally, this would be in v23proxy. This is in mojo.bindings.types because importing across modules is broken in mojo.
import "mojo/public/interfaces/bindings/mojom_types.mojom";
interface V23 {
// Sets up a communication channel between the caller and the mojo application
// running in a remote process.
//
// v23Name: Vanadium object name (i.e., "address") at which the remote mojo
// application is running.
// ifaceSig: Interface that the remote mojo application is expected to
// implement.
// mapping: Type definitions (indexed by type name) of the various types
// described in ifaceSig.
// serviceName: Name of the mojo application (i.e., the name that would be
// used if connecting to the application locally).
// futureMessages: Pipe over which messages can be sent to/received from
// serviceName running on the remote service v23Name.
SetupProxy(string v23Name,
MojomInterface ifaceSig,
map<string, UserDefinedType> mapping,
string serviceName,
handle<message_pipe> futureMessages);
// Endpoints gets the endpoints that the v23proxy serves at.
Endpoints() => (array<string> endpoints);
};
interface Advertiser {
// Advertises the existence of a service.
Advertise(Service service, array<string> visibility) => (string? InstanceId, string? Error);
// Stops advertising a specific instanceId
StopAdvertising(string InstanceId);
};
// Mostly copied from v.io/v23/discovery/types.vdl
struct Service {
// The universal unique identifier of a service instance.
// If this is not specified, a random 128 bit (16 byte) UUID will be used.
string? InstanceId;
// Optional name of the service instance.
string? InstanceName;
// The interface that the service implements.
// E.g., 'v.io/v23/services/vtrace.Store'.
string InterfaceName;
// The service attributes.
// E.g., {'resolution': '1024x768'}.
map<string, string>? Attrs;
// The url of the advertising mojo service
string Url;
};