cfmessagebus

package module
v0.0.0-...-199b5f1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2014 License: Apache-2.0, BSD-3-Clause, MIT Imports: 6 Imported by: 8

README

Build Status

Go CF Message Bus

This repository contains the source code for the Go implementation of a message bus wrapper for Cloud Foundry components.

Goal

  • Abstract the actual message bus implementation away from the internals of the rest of the codebase.
  • Allow changing the message bus being used without needing to rewrite the rest of the Go components.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

type DefaultLogger struct{}

func (*DefaultLogger) Debug

func (dl *DefaultLogger) Debug(string)

func (*DefaultLogger) Debugd

func (dl *DefaultLogger) Debugd(map[string]interface{}, string)

func (*DefaultLogger) Error

func (dl *DefaultLogger) Error(string)

func (*DefaultLogger) Errord

func (dl *DefaultLogger) Errord(map[string]interface{}, string)

func (*DefaultLogger) Fatal

func (dl *DefaultLogger) Fatal(string)

func (*DefaultLogger) Fatald

func (dl *DefaultLogger) Fatald(map[string]interface{}, string)

func (*DefaultLogger) Info

func (dl *DefaultLogger) Info(string)

func (*DefaultLogger) Infod

func (dl *DefaultLogger) Infod(map[string]interface{}, string)

func (*DefaultLogger) Warn

func (dl *DefaultLogger) Warn(string)

func (*DefaultLogger) Warnd

func (dl *DefaultLogger) Warnd(map[string]interface{}, string)

type Logger

type Logger interface {
	Fatal(string)
	Error(string)
	Warn(string)
	Info(string)
	Debug(string)

	Fatald(map[string]interface{}, string)
	Errord(map[string]interface{}, string)
	Warnd(map[string]interface{}, string)
	Infod(map[string]interface{}, string)
	Debugd(map[string]interface{}, string)
}

type MessageBus

type MessageBus interface {
	Configure(host string, port int, user string, password string)
	Connect() error
	Subscribe(subject string, callback func(payload []byte)) error
	UnsubscribeAll() error
	Publish(subject string, message []byte) error
	Request(subject string, message []byte, callback func(response []byte)) error
	Ping() bool
	RespondToChannel(subject string, callback func(request []byte) []byte) error
	OnConnect(func())
	SetLogger(Logger)
}

func NewMessageBus

func NewMessageBus(adapter string) (MessageBus, error)

type NatsAdapter

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

func NewNatsAdapter

func NewNatsAdapter() *NatsAdapter

func (*NatsAdapter) Configure

func (adapter *NatsAdapter) Configure(host string, port int, user string, password string)

func (*NatsAdapter) Connect

func (adapter *NatsAdapter) Connect() error

func (*NatsAdapter) OnConnect

func (adapter *NatsAdapter) OnConnect(callback func())

func (*NatsAdapter) Ping

func (adapter *NatsAdapter) Ping() bool

func (*NatsAdapter) Publish

func (adapter *NatsAdapter) Publish(subject string, message []byte) error

func (*NatsAdapter) Request

func (adapter *NatsAdapter) Request(subject string, message []byte, callback func(payload []byte)) error

func (*NatsAdapter) RespondToChannel

func (adapter *NatsAdapter) RespondToChannel(subject string, replyCallback func([]byte) []byte) error

func (*NatsAdapter) SetLogger

func (adapter *NatsAdapter) SetLogger(logger Logger)

func (*NatsAdapter) Subscribe

func (adapter *NatsAdapter) Subscribe(subject string, callback func(payload []byte)) error

func (*NatsAdapter) UnsubscribeAll

func (adapter *NatsAdapter) UnsubscribeAll() error

type Subscription

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

type WrongAdapterError

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

MyError is an error implementation that includes a time and message.

func (WrongAdapterError) Error

func (e WrongAdapterError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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