connectionlog

package
v0.0.0-...-b1e6648 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceLog

type DeviceLog struct {
	Id        string    `json:"id"`
	Connected bool      `json:"connected"`
	Time      time.Time `json:"time"`
}

type HubLog

type HubLog struct {
	Id        string    `json:"id"`
	Connected bool      `json:"connected"`
	Time      time.Time `json:"time"`
}

type Logger

type Logger interface {
	LogDeviceDisconnect(id string) error
	LogDeviceConnect(id string) error
	LogHubConnect(gateway string) error
	LogHubDisconnect(gateway string) error
}

func New

func New(ctx context.Context, kafkaBootstrapUrl string, sync bool, idempotent bool, deviceLogTopic string, hubLogTopic string, partitionNum int, replicationFactor int) (logger Logger, err error)

deprecated

func NewWithKafkaConfig

func NewWithKafkaConfig(ctx context.Context, kafkaBootstrapUrl string, deviceLogTopic string, hubLogTopic string, config kafka.Config) (logger Logger, err error)

func NewWithProducer

func NewWithProducer(producer kafka.ProducerInterface, deviceLogTopic string, hubLogTopic string) (logger Logger, err error)

type LoggerImpl

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

func (*LoggerImpl) LogDeviceConnect

func (this *LoggerImpl) LogDeviceConnect(id string) error

func (*LoggerImpl) LogDeviceDisconnect

func (this *LoggerImpl) LogDeviceDisconnect(id string) error

func (*LoggerImpl) LogHubConnect

func (this *LoggerImpl) LogHubConnect(id string) error

func (*LoggerImpl) LogHubDisconnect

func (this *LoggerImpl) LogHubDisconnect(id string) error

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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