Documentation ¶
Overview ¶
Package ssgrpc provides a ss.MultihomeBackend interface that uses grpc with profobufs for synchronizing broadcasts and roomcasts between multiple Sacrificial Socket instances.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrBadRPCCredentials = errors.New("the client provided invalid RPC credentials") ErrNilBroadcastChannel = errors.New("broadcast channel is not open yet") ErrNilRoomcastChannel = errors.New("roomcast channel is not open yet") ErrBadDataType = errors.New("bad data type used") ErrBadContext = errors.New("bad context used in transport") )
Functions ¶
This section is empty.
Types ¶
type GRPCMHB ¶
type GRPCMHB struct {
// contains filtered or unexported fields
}
GRPCMHB... yep that's what I'm calling it. All you need to know is that GRPCMHB satisfies the ss.MultihomeBackend interface
func NewBackend ¶
func NewBackend(tlsKeyFile, tlsCertFile, grpcHostPort string, sharedKey []byte, peerList []string) *GRPCMHB
NewBackend returns a GRPCMHB that will use TLS and HMAC-SHA256 signed JWTs to connect and authenticate to the peers in peerList
func NewInsecureBackend ¶
NewInsecureBackend returns a GRPCMHB that will use no encryption or authentication to connect to the peers in peerList
It is highly discouraged to use this for production systems, as all data will be sent in clear text and no authentication will be done on peer connections
func (*GRPCMHB) BroadcastFromBackend ¶
func (g *GRPCMHB) BroadcastFromBackend(b chan<- *ss.BroadcastMsg)
BroadcastFromBackend listens on the local grpc service for calls from remote peers and propagates broadcasts to locally connected websockets
func (*GRPCMHB) BroadcastToBackend ¶
func (g *GRPCMHB) BroadcastToBackend(b *ss.BroadcastMsg)
BroadcastToBackend propagates the broadcast to all active peer connections
func (*GRPCMHB) Init ¶
func (g *GRPCMHB) Init()
Init sets up the grpc server and creates connections to all grpc peers
func (*GRPCMHB) RoomcastFromBackend ¶
RoomcastFromBackend listens on the local grpc service for calls from remote peers and propagates roomcasts to locally connected websockets
func (*GRPCMHB) RoomcastToBackend ¶
RoomcastToBackend propagates the roomcast to all active peer connections
Directories ¶
Path | Synopsis |
---|---|
Package token is used by package ssgrpc for generating and validating HMAC-SHA256 tokens sent as "per RPC credentials".
|
Package token is used by package ssgrpc for generating and validating HMAC-SHA256 tokens sent as "per RPC credentials". |
Package transport is a generated protocol buffer package.
|
Package transport is a generated protocol buffer package. |