channel

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	Init(*zap.Logger, trace.Tracer, interface{})
	Run()
	SetChannel(<-chan model.ChanneledEvent)
	Name() string
}

type Config

type Config struct {
	Enabled        []string               `koanf:"enabled"`
	Configurations map[string]interface{} `koanf:"configurations"`
}

type Manager

type Manager struct {
	Plugins []Channel
	// contains filtered or unexported fields
}

Manager manages Channels.

func New

func New(logger *zap.Logger, tracer trace.Tracer) *Manager

New create new manager.

func (*Manager) Channels

func (m *Manager) Channels() []chan<- model.ChanneledEvent

Channels return the channels to register them on subscriber in the main.

func (*Manager) Register

func (m *Manager) Register(p Channel, cfg interface{})

Register registers the given channel and passes its configration to it. Also runs it in new goroutine.

func (*Manager) Setup

func (m *Manager) Setup(enabled []string, cfg map[string]interface{})

Setup registers the given channel. please note that you should add each channel here.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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