From 24b8cd3d97b6ae02d9310b918f56157cfdab1162 Mon Sep 17 00:00:00 2001 From: Asim Date: Thu, 26 Nov 2015 00:23:36 +0000 Subject: [PATCH] more comments --- server/options.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/options.go b/server/options.go index 69fb875c..ce90c51a 100644 --- a/server/options.go +++ b/server/options.go @@ -83,60 +83,70 @@ func (o options) Metadata() map[string]string { return o.metadata } +// Server name func Name(n string) Option { return func(o *options) { o.name = n } } +// Unique server id func Id(id string) Option { return func(o *options) { o.id = id } } +// Version of the service func Version(v string) Option { return func(o *options) { o.version = v } } +// Address to bind to - host:port func Address(a string) Option { return func(o *options) { o.address = a } } +// The address to advertise for discovery - host:port func Advertise(a string) Option { return func(o *options) { o.advertise = a } } +// Broker to use for pub/sub func Broker(b broker.Broker) Option { return func(o *options) { o.broker = b } } +// Codec to use to encode/decode requests for a given content type func Codec(contentType string, cf CodecFunc) Option { return func(o *options) { o.codecs[contentType] = cf } } +// Registry used for discovery func Registry(r registry.Registry) Option { return func(o *options) { o.registry = r } } +// Transport mechanism for communication e.g http, rabbitmq, etc func Transport(t transport.Transport) Option { return func(o *options) { o.transport = t } } +// Metadata associated with the server func Metadata(md map[string]string) Option { return func(o *options) { o.metadata = md