criers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetString

func GetString(data []byte, text string) (string, error)

Types

type AzSbConfig

type AzSbConfig struct {
	Endpoint string                 `yaml:"endpoint"`
	Topic    string                 `yaml:"topic"`
	Layout   map[string]interface{} `yaml:"layout"`
}

type AzSbSink

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

func (*AzSbSink) Close

func (azs *AzSbSink) Close()

func (*AzSbSink) Send

func (azs *AzSbSink) Send(ctx context.Context, dat []byte) error

type Crier

type Crier interface {
	Send(ctx context.Context, data []byte) error
	Close()
}

Crier is the interface for sending out data. It should get raw data and package it appropriately based on the message destination

func NewAzSbSink

func NewAzSbSink(cfg *AzSbConfig) (Crier, error)

func NewNatsSbSink

func NewNatsSbSink(cfg *NatsSbConfig) (Crier, error)

type NatsSbConfig

type NatsSbConfig struct {
	Endpoint string                 `yaml:"endpoint"`
	Topic    string                 `yaml:"topic"`
	Layout   map[string]interface{} `yaml:"layout"`
}

type NatsSbSink

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

func (*NatsSbSink) Close

func (n *NatsSbSink) Close()

func (*NatsSbSink) Send

func (n *NatsSbSink) Send(ctx context.Context, dat []byte) error

type ReceiverConfig

type ReceiverConfig struct {
	Name   string        `yaml:"name"`
	Azsb   *AzSbConfig   `yaml:"azsb"`
	Nats   *NatsSbConfig `yaml:"nats"`
	Stdout *StdoutConfig `yaml:"stdout"`
}

func (*ReceiverConfig) GetCrier

func (r *ReceiverConfig) GetCrier() (Crier, error)

func (*ReceiverConfig) Validate

func (r *ReceiverConfig) Validate() error

type Stdout

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

func NewStdoutSink

func NewStdoutSink(config *StdoutConfig) (*Stdout, error)

func (*Stdout) Close

func (f *Stdout) Close()

func (*Stdout) Send

func (f *Stdout) Send(ctx context.Context, data []byte) error

type StdoutConfig

type StdoutConfig struct {
	Layout map[string]interface{} `yaml:"layout"`
}

func (*StdoutConfig) Validate

func (f *StdoutConfig) Validate() error

Jump to

Keyboard shortcuts

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