rpc

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCClientOptions

func GRPCClientOptions(tlsCertificateAuthorityPath, tlsCertificatePath, tlsPrivateKey string, insecureSkipVerify bool) []grpc.DialOption

func GRPCServerOptions

func GRPCServerOptions(mTLS bool, tlsCertificateAuthorityPath, tlsCertificatePath, tlsPrivateKey string) []grpc.ServerOption

func GenerateSelfSignedCertificate

func GenerateSelfSignedCertificate(cn string, san []string, ipAddresses []net.IP) (*tls.Certificate, error)

func ListLocalIP

func ListLocalIP() []net.IP

func Server

func Server(config ServerConfig) *grpc.Server

Types

type ClientConfig

type ClientConfig struct {
	TLSCertificateAuthorityPath string
	TLSCertificatePath          string
	TLSPrivateKeyPath           string
	InsecureSkipVerify          bool
}

type Dialer

type Dialer func(address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func GRPCDialer

func GRPCDialer(config ClientConfig) Dialer

type FSM

type FSM interface {
	RetainedMessage(ctx context.Context, publish *packet.Publish) error
	DeleteRetainedMessage(ctx context.Context, topic []byte) error
	Subscribe(ctx context.Context, id string, pattern []byte, qos int32) error
	SubscribeFrom(ctx context.Context, id string, peer uint64, pattern []byte, qos int32) error
	Unsubscribe(ctx context.Context, id string, pattern []byte) error
	DeleteSessionMetadata(ctx context.Context, id, mountpoint string) error
	CreateSessionMetadata(ctx context.Context, id, clientID string, lwt *packet.Publish, mountpoint string) error
}

type MqttServer

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

func NewMQTTServer

func NewMQTTServer(state State, fsm FSM, localPublishCh, remotePublishCh chan *packet.Publish) *MqttServer

func (*MqttServer) CreateSubscription

func (*MqttServer) DeleteSubscription

func (*MqttServer) DistributeMessage

func (*MqttServer) ListSubscriptions

func (*MqttServer) Serve

func (s *MqttServer) Serve(grpcServer *grpc.Server)

type NodeRPCServer

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

func NewNodeRPCServer

func NewNodeRPCServer(cancelCh chan<- struct{}) *NodeRPCServer

func (*NodeRPCServer) Shutdown

type ServerConfig

type ServerConfig struct {
	TLSCertificateAuthorityPath string
	TLSCertificatePath          string
	TLSPrivateKeyPath           string
	VerifyClientCert            bool
}

type State

type State interface {
	ListSessionMetadatas() []*api.SessionMetadatas
	ListSubscriptions() ([][]byte, []uint64, []string, []int32, error)
}

Jump to

Keyboard shortcuts

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