plain

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "PLAIN"

Variables

This section is empty.

Functions

func NewServer

func NewServer() mech.Mechanism

Types

type Client

type Client struct {
}

Client represents a PLAIN mech.

func NewClient

func NewClient() *Client

NewClient returns a new PLAIN client.

func (*Client) Name

func (client *Client) Name() string

Name returns the mechanism name.

func (*Client) Start

func (client *Client) Start(opts ...mech.Option) (mech.Context, error)

Start returns the initial context.

func (*Client) Type

func (client *Client) Type() mech.Type

Type returns the mechanism type.

type ClientContext

type ClientContext struct {
	mech.Store
	// contains filtered or unexported fields
}

ClientContext represents a PLAIN client context.

func NewClientContext

func NewClientContext(m mech.Mechanism, opts ...mech.Option) (*ClientContext, error)

NewClientContext returns a new PLAIN client context.

func (*ClientContext) Dispose

func (ctx *ClientContext) Dispose() error

Dispose disposes the context.

func (*ClientContext) Done added in v1.2.0

func (ctx *ClientContext) Done() bool

Done returns true if the context is completed.

func (*ClientContext) Mechanism added in v1.2.1

func (ctx *ClientContext) Mechanism() mech.Mechanism

Mechanism returns the mechanism.

func (*ClientContext) Next

func (ctx *ClientContext) Next(opts ...mech.Parameter) (mech.Response, error)

Next returns the next response.

func (*ClientContext) Step

func (ctx *ClientContext) Step() int

Step returns the current step number. The step number is incremented by one after each call to Next.

type Message

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

Message represents a SASL PLAIN message.

func NewMessage

func NewMessage() *Message

NewMessage returns a new message.

func NewMessageFrom

func NewMessageFrom(v any) (*Message, error)

NewMessageFrom returns a new message from the given value.

func NewMessageWith

func NewMessageWith(authzid, authcid, passwd string) *Message

NewMessageWith returns a new message with the given authzid, authcid, and passwd.

func (*Message) Authcid

func (msg *Message) Authcid() string

Authcid returns the authentication identity.

func (*Message) Authzid

func (msg *Message) Authzid() string

Authzid returns the authorization identity.

func (*Message) Bytes

func (msg *Message) Bytes() []byte

Bytes returns the message bytes.

func (*Message) ParseBytes

func (msg *Message) ParseBytes(b []byte) error

ParseBytes parses the message bytes.

func (*Message) Passwd

func (msg *Message) Passwd() string

Passwd returns the password.

func (*Message) String

func (msg *Message) String() string

String returns the message string.

type Server

type Server struct {
}

Server represents a PLAIN mech.

func (*Server) Name

func (server *Server) Name() string

Name returns the mechanism name.

func (*Server) Start

func (server *Server) Start(opts ...mech.Option) (mech.Context, error)

Start returns the initial context.

func (*Server) Type

func (server *Server) Type() mech.Type

Type returns the mechanism type.

type ServerContext

type ServerContext struct {
	mech.Store

	*cred.CredentialStore
	// contains filtered or unexported fields
}

ServerContext represents a PLAIN server context.

func NewServerContext

func NewServerContext(m mech.Mechanism, opts ...mech.Option) (*ServerContext, error)

NewServerContext returns a new PLAIN server context.

func (*ServerContext) Dispose

func (ctx *ServerContext) Dispose() error

Dispose disposes the context.

func (*ServerContext) Done added in v1.2.0

func (ctx *ServerContext) Done() bool

Done returns true if the context is completed.

func (*ServerContext) Mechanism added in v1.2.1

func (ctx *ServerContext) Mechanism() mech.Mechanism

Mechanism returns the mechanism.

func (*ServerContext) Next

func (ctx *ServerContext) Next(opts ...mech.Parameter) (mech.Response, error)

Next returns the next response.

func (*ServerContext) Step

func (ctx *ServerContext) Step() int

Step returns the current step number. The step number is incremented by one after each call to Next.

Jump to

Keyboard shortcuts

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