blob: 03b37b71ecce0621090017895a9dbc7e8bca7ec9 [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.
package discovery
// Advertisement represents a feed into advertiser to broadcast its contents
// to scanners.
//
// A large advertisement may require additional RPC calls causing delay in
// discovery. We limit the maximum size of an advertisement to 512 bytes
// excluding id and attachments.
type Advertisement struct {
// Universal unique identifier of the advertisement.
// If this is not specified, a random unique identifier will be assigned.
Id AdId
// Interface name that the advertised service implements.
// E.g., 'v.io/v23/services/vtrace.Store'.
InterfaceName string
// Addresses (vanadium object names) that the advertised service is served on.
// E.g., '/host:port/a/b/c', '/ns.dev.v.io:8101/blah/blah'.
Addresses []string
// Attributes as a key/value pair.
// E.g., {'resolution': '1024x768'}.
//
// The key must be US-ASCII printable characters, excluding the '=' character
// and should not start with '_' character.
//
// We limit the maximum number of attachments to 32.
Attributes Attributes
// Attachments as a key/value pair.
// E.g., {'thumbnail': binary_data }.
//
// Unlike attributes, attachments are for binary data and they are not queryable.
//
// The key must be US-ASCII printable characters, excluding the '=' character
// and should not start with '_' character.
//
// We limit the maximum number of attachments to 32 and the maximum size of each
// attachment is 4K bytes.
Attachments Attachments
}
// An AdId is a globally unique identifier of an advertisement.
type AdId [16]byte
// Attributes represents service attributes as a key/value pair.
type Attributes map[string]string
// Attachments represents service attachments as a key/value pair.
type Attachments map[string][]byte