monza

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 3

README

monza

A friendly event rounting library to multiple destinations.

Destination Implementation

Middlewares

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	RegisterDestination(ctx context.Context, destination Destination) error
	Record(events Event)
	Teardown(ctx context.Context)
}

func Get

func Get(ctx context.Context, config Config) Client

type Config

type Config struct {
	IpAddress    string
	Destinations []Destination
}

type Destination

type Destination interface {
	Setup(ctx context.Context) error
	Record(ctx context.Context, event Event)
	Teardown(ctx context.Context)
}

type Event

type Event struct {
	Event      string      `json:"event,omitempty"`
	Data       interface{} `json:"data,omitempty"`
	ID         int64       `json:"id,omitempty"`
	ClientTime time.Time   `json:"client_time,omitempty"`
	IPAddr     string      `json:"ip_addr"`
	ServiceID  ServiceID   `json:"service_id"`
}

func (Event) JSON

func (e Event) JSON() []byte

type ServiceID

type ServiceID string

Jump to

Keyboard shortcuts

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