scram

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientWithType

func NewClientWithType(t Type) mech.Mechanism

NewSCRAM returns a new SCRAM mech.

func NewServerWithType

func NewServerWithType(t Type) mech.Mechanism

NewSCRAM returns a new SCRAM mech.

Types

type Client

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

Client represents a SCRAM mech.

func (*Client) Name

func (client *Client) Name() string

Name returns the mechanism name.

func (*Client) SetOptions added in v1.2.2

func (client *Client) SetOptions(opts ...mech.Option) error

SetOptions sets the mechanism options before starting.

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 {
	*scram.Client
	// contains filtered or unexported fields
}

ClientContext represents a SCRAM client context.

func NewClientContext

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

NewClientContext returns a new SCRAM 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 Server

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

Server represents a SCRAM mech.

func (*Server) Name

func (server *Server) Name() string

Name returns the mechanism name.

func (*Server) SetOptions added in v1.2.2

func (server *Server) SetOptions(opts ...mech.Option) error

SetOptions sets the mechanism options before starting.

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 {
	*scram.Server
	// contains filtered or unexported fields
}

ServerContext represents a SCRAM server context.

func NewServerContext

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

NewServerContext returns a new SCRAM 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.

type Type

type Type int

Type represents a SCRAM type.

const (
	SHA1 Type = iota
	SHA256
	SHA512
)

func SCRAMTypes

func SCRAMTypes() []Type

SCRAMTypes returns the SCRAM types.

func (Type) String

func (t Type) String() string

SCRAMType returns the SCRAM type.

Jump to

Keyboard shortcuts

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