exportedservice

package module
v0.0.0-...-e5a415a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2014 License: BSD-3-Clause Imports: 5 Imported by: 0

README

golang-doozer-exportedservice

Doozer exported HTTP/TCP/whatever service ports

Documentation

Overview

*

  • Exported named Doozer HTTP service.
  • Creates an HTTP server and exports it to Doozer.

*

  • Exported named Doozer port.
  • This binds to an anonymous port, exports the host:port pair through Doozer
  • and returns the port to the caller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceExporter

type ServiceExporter struct {
	// contains filtered or unexported fields
}

We need to initialize our Doozer client beforehand and keep it somewhere.

func NewExporter

func NewExporter(uri, buri string) (*ServiceExporter, error)

*

  • Try to create a new exporter by connecting to Doozer.

func (*ServiceExporter) ListenAndServeNamedHTTP

func (self *ServiceExporter) ListenAndServeNamedHTTP(
	servicename, addr string, handler http.Handler) error

*

  • Make the default HTTP server listen on "addr" and export the given
  • "handler". Register as "servicename".

func (*ServiceExporter) NewExportedPort

func (self *ServiceExporter) NewExportedPort(
	network, ip, servicename string) (net.Listener, error)

*

  • Open a new anonymous port on "ip" and export it through Doozer as
  • "servicename". If "ip" is a host:port pair, the port will be overridden.

func (*ServiceExporter) NewExportedTLSPort

func (self *ServiceExporter) NewExportedTLSPort(
	network, ip, servicename string,
	config *tls.Config) (net.Listener, error)

*

  • Open a new anonymous port on "ip" and export it through Doozer as
  • "servicename". Associate the TLS configuration "config". If "ip" is
  • a host:port pair, the port will be overridden.

func (*ServiceExporter) UnexportPort

func (self *ServiceExporter) UnexportPort() error

*

  • Remove the associated exported port. This will only delete the most
  • recently exported port.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL