gibson

package module
v0.0.0-...-1b9e3f0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: Apache-2.0, BSD-3-Clause, MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

 # This library is deprecated. The supported way to register routes is using [route-registrar](https://github.com/cloudfoundry-incubator/route-registrar)
 
                          ,dPYb,
                          IP'`Yb
                     gg   I8  8I
                     ""   I8  8'
          ,gggg,gg   gg   I8 dP       ,g,       ,ggggg,    ,ggg,,ggg,
         dP"  "Y8I   88   I8dP   88gg,8'8,     dP"  "Y8ggg,8" "8P" "8,
        i8'    ,8I   88   I8P    8I ,8'  Yb   i8'    ,8I  I8   8I   8I
        d8,   ,d8I _,88,_,d8b,  ,8I,8'_   8) ,d8,   ,d8' ,dP   8I   Yb,
         Y8888P"8888P""Y88P'"Y88P"'P' "YY8P8PP"Y8888P"   8P'   8I   `Y8
              ,d8I'
            ,dP'8I
           ,8"  8I
           I8   8I
           `8, ,8I
            `Y8P"


= About

Client library for interacting with Cloud Foundry's Router.

See https://github.com/cloudfoundry/gorouter


= Usage

    client := gibson.NewCFRouterClient("10.10.16.13", messageBus)

    // set up periodic registration
    // optional if all you want is a one-off registration
    client.Greet()

    client.Register(1234, "myhost.com")
    client.Unregister(1234, "myhost.com")

= Registrar Executable

If you don't care to write your own CF Router adapter, you can use the
`registrar` executable instead:

    go install github.com/cloudfoundry/gibson/registrar

    registrar -ip=my.local.address \
      -natsAddresses=1.2.3.4:4222
      -natsUsername=nats \
      -natsPassword=nats \
      -routes=8080:example.com,8081:example.org

The registrar will stay running and continue registering the given routes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CFRouterClient

type CFRouterClient struct {
	Host              string
	PrivateInstanceId string
	// contains filtered or unexported fields
}

func NewCFRouterClient

func NewCFRouterClient(host string, messageBus yagnats.NATSConn) *CFRouterClient

func (*CFRouterClient) Greet

func (r *CFRouterClient) Greet() error

func (*CFRouterClient) Register

func (r *CFRouterClient) Register(port int, uri string) error

func (*CFRouterClient) RegisterAll

func (r *CFRouterClient) RegisterAll(port int, uris []string) error

func (*CFRouterClient) Unregister

func (r *CFRouterClient) Unregister(port int, uri string) error

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) InParallel

func (r *Registry) InParallel(callback func(int, []string)) (count int)

func (*Registry) Register

func (r *Registry) Register(port int, uri string)

func (*Registry) RegisterAll

func (r *Registry) RegisterAll(port int, uris []string)

func (*Registry) Unregister

func (r *Registry) Unregister(port int, uri string)

type RegistryMessage

type RegistryMessage struct {
	URIs              []string `json:"uris"`
	Host              string   `json:"host"`
	Port              int      `json:"port"`
	PrivateInstanceId string   `json:"private_instance_id"`
}

type RouterClient

type RouterClient interface {
	Greet() error
	Register(port int, uri string) error
	RegisterAll(port int, uris []string) error
	Unregister(port int, uri string) error
}

type RouterGreetingMessage

type RouterGreetingMessage struct {
	MinimumRegisterInterval int `json:"minimumRegisterIntervalInSeconds"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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