common

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmpty

func IsEmpty(s string) bool

func MakeHttpClient

func MakeHttpClient(timeout int) *http.Client

Types

type Event

type Event struct {
	Time     string      `json:"time"`
	TimeNano int64       `json:"timeNano"`
	Channel  string      `json:"channel"`
	Type     string      `json:"type"`
	Data     interface{} `json:"data"`
}

func (*Event) JsonObject

func (e *Event) JsonObject() (interface{}, error)

type Input

type Input interface {
	Start(wg *sync.WaitGroup, outputs *Outputs)
}

type Inputs

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

func NewInputs

func NewInputs() *Inputs

func (*Inputs) Add

func (is *Inputs) Add(i *Input)

func (*Inputs) Start

func (is *Inputs) Start(wg *sync.WaitGroup, ots *Outputs)

type Output

type Output interface {
	Send(event *Event)
}

type Outputs

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

func NewOutputs

func NewOutputs(timeFormat string) *Outputs

func (*Outputs) Add

func (ots *Outputs) Add(o *Output)

func (*Outputs) Send

func (ots *Outputs) Send(e *Event)

Jump to

Keyboard shortcuts

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