msgsync

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 5 Imported by: 12

Documentation

Overview

Package msgsync propagates protobuf messages to a particular topic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Topic string
}

Cfg groups configurations fields. It can be extended with other fields (such as sync/async, partition...).

type Deps

type Deps struct {
	local.PluginInfraDeps               // inject
	Messaging             messaging.Mux // inject
	Cfg
}

Deps groups dependencies injected into the plugin so that they are logically separated from other plugin fields.

type PubPlugin

type PubPlugin struct {
	Deps // inject
	// contains filtered or unexported fields
}

PubPlugin implements KeyProtoValWriter that propagates protobuf messages to a particular topic (unless the messaging.Mux is not disabled).

func (*PubPlugin) AfterInit

func (plugin *PubPlugin) AfterInit() error

AfterInit uses provided MUX connection to build new publisher.

func (*PubPlugin) Close

func (plugin *PubPlugin) Close() error

Close resources.

func (*PubPlugin) Init

func (plugin *PubPlugin) Init() error

Init does nothing.

func (*PubPlugin) Put

func (plugin *PubPlugin) Put(key string, data proto.Message, opts ...datasync.PutOption) error

Put propagates this call to a particular messaging Publisher.

This method is supposed to be called in PubPlugin.AfterInit() or later (even from different go routine).

func (*PubPlugin) String

func (plugin *PubPlugin) String() string

String returns Deps.PluginName if set, "pub-msgsync" otherwise.

Jump to

Keyboard shortcuts

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