grpcd

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultListenType      = "tcp"
	DefaultListenAddr      = ":1408"
	DefaultMonitorInterval = util.Duration(time.Second * 10)
)

Variables

This section is empty.

Functions

func NewReply

func NewReply() *pb.Reply

Types

type Config

type Config struct {
	ListenType      string        `yaml:"ListenType,omitempty" mapstructure:"ListenType,omitempty"`
	ListenAddr      string        `yaml:"ListenAddr,omitempty" mapstructure:"ListenAddr,omitempty"`
	MonitorInterval util.Duration `yaml:"MonitorInterval,omitempty" mapstructure:"MonitorInterval,omitempty"`
}

func NewConfig

func NewConfig() Config

func (Config) GetListenAddr

func (c Config) GetListenAddr() string

func (Config) GetListenType

func (c Config) GetListenType() string

type GRPCd

type GRPCd struct {
	pb.UnimplementedSProxyServer

	Config  Config
	Logger  *zap.Logger
	Closing chan struct{}
	Closed  chan struct{}
	// contains filtered or unexported fields
}

func New

func New(config Config) (*GRPCd, error)

func (*GRPCd) Close

func (grpcd *GRPCd) Close() error

func (*GRPCd) Open

func (grpcd *GRPCd) Open() error

func (*GRPCd) SendToInfluxdb

func (grpcd *GRPCd) SendToInfluxdb(ctx context.Context, lines *pb.InfluxdbMsg) (*pb.Reply, error)

func (*GRPCd) SendToInfluxdbStream

func (grpcd *GRPCd) SendToInfluxdbStream(stream pb.SProxy_SendToInfluxdbStreamServer) error

func (*GRPCd) SendToKafka

func (grpcd *GRPCd) SendToKafka(ctx context.Context, msg *pb.KafkaMsg) (*pb.Reply, error)

func (*GRPCd) SendToKafkaStream

func (grpcd *GRPCd) SendToKafkaStream(stream pb.SProxy_SendToKafkaStreamServer) error

func (*GRPCd) SetInfluxdbService

func (grpcd *GRPCd) SetInfluxdbService(s *influxdb.Service)

func (*GRPCd) SetKafkaService

func (grpcd *GRPCd) SetKafkaService(s *kafka.Service)

func (*GRPCd) WithLogger

func (grpcd *GRPCd) WithLogger(logger *zap.Logger)

type Pool

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

func NewPool

func NewPool() *Pool

func (*Pool) Get

func (p *Pool) Get() *Reply

type Reply

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

func GetReplyWrapper

func GetReplyWrapper() *Reply

func (*Reply) AddFail

func (r *Reply) AddFail(num uint32)

func (*Reply) AddSuccess

func (r *Reply) AddSuccess(num uint32)

func (*Reply) Free

func (r *Reply) Free()

func (*Reply) GetReply

func (r *Reply) GetReply() *pb.Reply

type Statistics

type Statistics struct {
	KafkaReceived         uint64
	KafkaReceivedError    uint64
	InfluxdbReceived      uint64
	InfluxdbReceivedError uint64
}

Jump to

Keyboard shortcuts

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