mech

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound represents a not found error.

Functions

This section is empty.

Types

type AuthzID added in v1.2.0

type AuthzID string

AuthzID represents an authorization ID option.

type Challenge added in v1.2.0

type Challenge []byte

Challenge represents a challenge.

type Context

type Context interface {
	// Store represents a SASL mechanism store.
	Store
	// Mechanism returns the mechanism.
	Mechanism() Mechanism
	// Next returns the next response.
	Next(...Parameter) (Response, error)
	// Step returns the current step number. The step number is incremented by one after each call to Next.
	Step() int
	// Done returns true if the context is completed.
	Done() bool
	// Dispose disposes the context.
	Dispose() error
}

Context represents a SASL mechanism context.

type Email

type Email string

Email represents an email.

type Group

type Group string

Group represents a group option.

type HashFunc added in v1.2.0

type HashFunc func() hash.Hash

HashFunc represents a hash function.

type IterationCount added in v1.2.0

type IterationCount int

IterationCount represents an iteration count.

type Mechanism

type Mechanism interface {
	// Name returns the mechanism name.
	Name() string
	// Type returns the mechanism type.
	Type() Type
	// SetOptions sets the mechanism options before starting.
	SetOptions(...Option) error
	// Start returns the initial context.
	Start(...Option) (Context, error)
}

Mechanism represents a SASL mechanism.

type Option

type Option = any

Option represents a SASL mechanism option.

type Parameter

type Parameter = any

Parameter represents a SASL mechanism parameter.

type Password

type Password string

Password represents a password option.

type Payload added in v1.1.0

type Payload []byte

Payload represents a payload.

type RandomSequence added in v1.2.0

type RandomSequence string

RandomSequence represents a random sequence.

type Response

type Response interface {
	// Bytes returns the response bytes.
	Bytes() []byte
	// String returns the response as a string.
	String() string
}

Response represents a SASL mechanism response.

type Salt added in v1.2.0

type Salt []byte

Salt represents a salt.

type Store added in v1.2.0

type Store interface {
	// SetValue sets the context value.
	SetValue(key string, value any)
	// Value returns the context value.
	Value(key string) (any, bool)
	// ValueTo returns the context value as a specific type.
	ValueTo(key string, v any) bool
}

Store represents a SASL mechanism store.

func NewStore added in v1.2.0

func NewStore() Store

NewContext returns a new Context.

type Token

type Token string

Token represents a token.

type Type

type Type int

Type represents a SASL mechanism type.

const (
	Client Type = iota
	Server
)

func Types

func Types() []Type

Types returns the SASL mechanism types.

func (Type) String

func (t Type) String() string

String returns the SASL mechanism type.

type Username

type Username string

Username represents a username option.

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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