package plainsession

import "github.com/hlandau/parazmq/plainsession"

Index

Functions

func New

func New(fc abstract.FrameConn, cfg PlainConfig) (ps abstract.FrameConn, err error)

Creates a PlainSession over the FrameConn as specified by the PlainConfig.

Types

type PlainConfig

type PlainConfig struct {
	IsServer bool
	Metadata map[string]string

	Username string
	Password string

	ServerValidateFunc func(username, password string) bool
}

type PlainSession

type PlainSession struct {
	abstract.FrameConn
	// contains filtered or unexported fields
}

A PlainSession performs the PLAIN authentication mode handshake and exchanges frames in the process so described by the specification. The ZMTP/3.x greeting must already be complete.

func (*PlainSession) Close

func (s *PlainSession) Close() error

func (*PlainSession) ReceiveFrame

func (s *PlainSession) ReceiveFrame() ([]byte, abstract.ZMTPFlags, error)

func (*PlainSession) RemoteMetadata

func (s *PlainSession) RemoteMetadata() map[string]string

Returns the remote metadata received during the handshake process.

func (*PlainSession) SendFrame

func (s *PlainSession) SendFrame(data []byte, flags abstract.ZMTPFlags) error

Source Files

plainsession.go

Version
v0.0.0-20210323063629-d55c8d2d05c8 (latest)
Published
Mar 23, 2021
Platform
linux/amd64
Imports
3 packages
Last checked
1 month ago

Tools for package owners.