Merge "Fix flakyness of Conflict Resolution integration tests."
diff --git a/discovery/.api b/discovery/.api
index 6fc8be6..0174f42 100644
--- a/discovery/.api
+++ b/discovery/.api
@@ -9,6 +9,7 @@
pkg discovery, type AdvertiseCloser interface, Close()
pkg discovery, type Advertiser interface { Advertise }
pkg discovery, type Advertiser interface, Advertise(*context.T, *Service, []security.BlessingPattern) (<-chan struct{}, error)
+pkg discovery, type Attachments map[string][]byte
pkg discovery, type Attributes map[string]string
pkg discovery, type Closer interface { Close }
pkg discovery, type Closer interface, Close()
@@ -23,6 +24,7 @@
pkg discovery, type Scanner interface, Scan(*context.T, string) (<-chan Update, error)
pkg discovery, type Service struct
pkg discovery, type Service struct, Addrs []string
+pkg discovery, type Service struct, Attachments Attachments
pkg discovery, type Service struct, Attrs Attributes
pkg discovery, type Service struct, InstanceId string
pkg discovery, type Service struct, InstanceName string
diff --git a/discovery/types.vdl b/discovery/types.vdl
index b915af8..b48dd1e 100644
--- a/discovery/types.vdl
+++ b/discovery/types.vdl
@@ -20,6 +20,11 @@
// The addresses (vanadium object names) that the service is served on.
// E.g., '/host:port/a/b/c', '/ns.dev.v.io:8101/blah/blah'.
Addrs []string
+ // The service attachments.
+ // E.g., {'thumbnail': binary_data }.
+ //
+ // WARNING: THIS FIELD IS NOT SUPPORTED YET.
+ Attachments Attachments
}
// Attributes represents service attributes as a key/value pair.
@@ -28,6 +33,15 @@
// and should not start with '_' character.
type Attributes map[string]string
+// Attachments represents service attachments as a key/value pair. Unlike
+// attributes, attachments are mostly for larger binary data and they are
+// not queryable. It is recommended to put as small attachments as possible
+// since it may require additional RPC calls causing delay in discovery.
+//
+// The key must be US-ASCII printable characters, excluding the '=' character
+// and should not start with '_' character.
+type Attachments map[string][]byte
+
// Found represents a service that is discovered by scan.
type Found struct {
Service Service
diff --git a/discovery/types.vdl.go b/discovery/types.vdl.go
index d3cec69..9f613b7 100644
--- a/discovery/types.vdl.go
+++ b/discovery/types.vdl.go
@@ -28,6 +28,11 @@
// The addresses (vanadium object names) that the service is served on.
// E.g., '/host:port/a/b/c', '/ns.dev.v.io:8101/blah/blah'.
Addrs []string
+ // The service attachments.
+ // E.g., {'thumbnail': binary_data }.
+ //
+ // WARNING: THIS FIELD IS NOT SUPPORTED YET.
+ Attachments Attachments
}
func (Service) __VDLReflect(struct {
@@ -46,6 +51,20 @@
}) {
}
+// Attachments represents service attachments as a key/value pair. Unlike
+// attributes, attachments are mostly for larger binary data and they are
+// not queryable. It is recommended to put as small attachments as possible
+// since it may require additional RPC calls causing delay in discovery.
+//
+// The key must be US-ASCII printable characters, excluding the '=' character
+// and should not start with '_' character.
+type Attachments map[string][]byte
+
+func (Attachments) __VDLReflect(struct {
+ Name string `vdl:"v.io/v23/discovery.Attachments"`
+}) {
+}
+
// Found represents a service that is discovered by scan.
type Found struct {
Service Service
@@ -108,6 +127,7 @@
func init() {
vdl.Register((*Service)(nil))
vdl.Register((*Attributes)(nil))
+ vdl.Register((*Attachments)(nil))
vdl.Register((*Found)(nil))
vdl.Register((*Lost)(nil))
vdl.Register((*Update)(nil))