kafka

package
v0.0.0-...-757bf47 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArcBuffer

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

ArcBuffer -

type Client

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

Client -

func NewKafkaClient

func NewKafkaClient(logger logging.ILogger, k *arcKafka.Kafka, config *config.ArcConfig) *Client

NewKafkaClient -

func (*Client) SendResultToKafka

func (kc *Client) SendResultToKafka(arr *ArcBuffer) error

SendResultToKafka -

type Handler

type Handler interface {
	Start(context.Context)
	Write(uint64, *protocols.Frame) error
	Stop()
}

Handler -

func New

func New(opts ...Option) (Handler, error)

New -

type MessageData

type MessageData struct {
	Ts       int64   `json:"ts"`
	SensorID string  `json:"sensorID"` // sensor
	ArcData  float64 `json:"arcData"`  // arc
}

MessageData -

type Option

type Option func(opts *Server)

Option is a function that will set up option.

func WithConfig

func WithConfig(c *config.ArcConfig) Option

WithConfig -

func WithKafka

func WithKafka(k interface{}) Option

WithKafka -

func WithLogger

func WithLogger(logger logging.ILogger) Option

WithLogger -

type Server

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

Server - 时序数据库管理结构

func (*Server) Start

func (s *Server) Start(ctx context.Context)

Start -

func (*Server) Stop

func (s *Server) Stop()

Stop -

func (*Server) Write

func (s *Server) Write(id uint64, frame *protocols.Frame) error

Write -

Jump to

Keyboard shortcuts

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