channels

package
v0.0.0-...-55f5b86 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChannelByIds = make(map[string]Channel)

Functions

func RegisterChannel

func RegisterChannel(c Channel)

Types

type Action

type Action struct {
}

type Channel

type Channel interface {
	GetId() string
	GetName() string
	GetDescription() string
	NewLink() Link
}

type Channels

type Channels struct {
	Links []json.RawMessage
	// contains filtered or unexported fields
}
func (c *Channels) GetLinks() []Link

func (*Channels) Init

func (c *Channels) Init() error

func (*Channels) MarshalJSON

func (c *Channels) MarshalJSON() ([]byte, error)

func (*Channels) Start

func (c *Channels) Start(eventsIn chan<- Event)

type CommonChannel

type CommonChannel struct {
	Id          string
	Name        string
	Description string
}

func (CommonChannel) GetDescription

func (c CommonChannel) GetDescription() string

func (CommonChannel) GetId

func (c CommonChannel) GetId() string

func (CommonChannel) GetName

func (c CommonChannel) GetName() string

func (CommonChannel) String

func (c CommonChannel) String() string
type CommonLink struct {
	Channel     string
	Name        string `json:",omitempty"`
	Description string `json:",omitempty"`
	// contains filtered or unexported fields
}

func (*CommonLink) GetDescription

func (l *CommonLink) GetDescription() string

func (*CommonLink) GetFields

func (l *CommonLink) GetFields() data.Fields

func (*CommonLink) GetName

func (l *CommonLink) GetName() string

func (*CommonLink) Init

func (l *CommonLink) Init() error

func (*CommonLink) Trigger

func (l *CommonLink) Trigger(cxt context.Context, action Action) error

func (*CommonLink) Watch

func (l *CommonLink) Watch(shutdown <-chan struct{}, events chan<- Event)

type Event

type Event struct {
	LinkName  string
	PointName string
	Time      time.Time    // optional, will be set to now() if omitted
	Metas     Placeholders // headers
	Value     interface{}  // body
}
type Link interface {
	Init() error
	GetName() string
	GetDescription() string
	Watch(shutdown <-chan struct{}, events chan<- Event)
	Trigger(cxt context.Context, action Action) error
	GetFields() data.Fields
}

func LinkFromJson

func LinkFromJson(content []byte) (Link, error)

type LinkLifecycle

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

func NewLinkLifecycle

func NewLinkLifecycle(link Link) LinkLifecycle

func (*LinkLifecycle) IsRunning

func (p *LinkLifecycle) IsRunning() bool

func (*LinkLifecycle) Start

func (p *LinkLifecycle) Start(events chan<- Event)

func (*LinkLifecycle) Stop

func (p *LinkLifecycle) Stop()

type Placeholder

type Placeholder struct {
	Name string
	//Type  string
	Value interface{}
}

type Placeholders

type Placeholders []Placeholder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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