broker

package
v0.0.0-...-f0a05f1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUB = "1"
	PUB = "2"
)
View Source
const (
	MWC = "#"

	SWC = "+"
)
View Source
const (
	QosAtMostOnce  = 0x00
	QosAtLeastOnce = 0x01
	QosExactlyOnce = 0x02
	QosFailure     = 0x80
	QosMax         = 0x01
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BConfig

type BConfig struct {
	Reset int
}

type Bridge

type Bridge struct {
	Name  string
	Kafka Kafka
}

type Broker

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

func NewBroker

func NewBroker(config *Config) (*Broker, error)

func (*Broker) Close

func (b *Broker) Close()

func (*Broker) ReadPacket

func (b *Broker) ReadPacket(r io.Reader) (packets.ControlPacket, error)

func (*Broker) Start

func (b *Broker) Start() error

type Client

type Client struct {
	Retry       int
	Reset       int
	WaitConnect int
	Connection  Connection
}

type Cluster

type Cluster struct {
	Enable              bool
	External            string
	Host                string
	TcpPort             int
	LeaseKeyPrefix      string
	Lease               int64
	RenewLeaseInterval  int64
	SyncBrokersInterval int64
	PeerConnMaxInterval int
	Etcd                Etcd
	Proxy               Proxy
}

type Config

type Config struct {
	Title    string
	Owner    Owner
	Mode     Mode
	Broker   BConfig
	Serve    Serve
	Client   Client
	Peer     Peer
	Cluster  Cluster
	Session  Session
	Receiver Receiver
	Sender   Sender
	Bridge   Bridge
}

func Configure

func Configure(args []string) (*Config, error)

type ConnStatus

type ConnStatus int32
const (
	ConnStatusInit       ConnStatus = 0
	ConnStatusConnecting ConnStatus = 1
	ConnStatusConnected  ConnStatus = 2
	ConnStatusBroken     ConnStatus = 3
	ConnStatusClosed     ConnStatus = 4
)

type ConnType

type ConnType int32
const (
	ConnTypClient ConnType = 0
	ConnTypPeer   ConnType = 1
)

type Connection

type Connection struct {
	Max uint64
}

type DeliverMap

type DeliverMap struct {
	Key   string
	Value string
}

type Etcd

type Etcd struct {
	Endpoints []string
	Timeout   int64
}

type GRPC

type GRPC struct {
	Host string
	Port int
}

type HTTP

type HTTP struct {
	Host string
	Port int
}

type InflightPacket

type InflightPacket struct {
	Packet packets.ControlPacket
	Time   time.Time
}

type Kafka

type Kafka struct {
	Endpoints     []string
	OnConnect     string
	OnPublish     string
	OnSubscribe   string
	OnDisconnect  string
	OnUnsubscribe string
	DeliverMap    []DeliverMap
}

type Mode

type Mode struct {
	Debug bool
}

type Owner

type Owner struct {
	Name    string
	Created time.Time
	Updated time.Time
}

type Peer

type Peer struct {
	Reset int
}

type Proxy

type Proxy struct {
	PoolSize         int
	Retry            int
	SendTimeout      int
	AckChan          int
	SendSubUnsubChan int
	Inflight         int
	SubUnsubQueue    int
}

type Receiver

type Receiver struct {
	Client ReceiverConfig
	Peer   ReceiverConfig
}

type ReceiverConfig

type ReceiverConfig struct {
	RecvChan int
}

type Sender

type Sender struct {
	Retry   int
	Timeout int
	Client  SenderConfig
	Peer    SenderConfig
}

type SenderConfig

type SenderConfig struct {
	AckChan int
	PubChan int
}

type Serve

type Serve struct {
	GRPC GRPC
	HTTP HTTP
	TCP  TCP
	TLS  TLS
	WS   WS
	WSS  WSS
}

type Session

type Session struct {
	Client SessionConfig
	Peer   SessionConfig
}

type SessionConfig

type SessionConfig struct {
	ZQueue   int
	OTQueue  int
	Inflight int
}

type TCP

type TCP struct {
	Enable bool
	Host   string
	Port   int
}

type TLS

type TLS struct {
	Enable  bool
	Host    string
	Port    int
	Verify  bool
	CaPem   string
	CertPem string
	KeyPem  string
}

type TopicType

type TopicType int32
const (
	SUBType   TopicType = 0
	UNSUBType TopicType = 1
)

type WS

type WS struct {
	Enable bool
	Host   string
	Port   int
	Path   string
}

type WSS

type WSS struct {
	Enable  bool
	Host    string
	Port    int
	Path    string
	CaPem   string
	CertPem string
	KeyPem  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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