conninfo

package
v0.0.0-...-bb56650 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package conninfo provides access to connection-specific information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ctx

func Ctx(ctx context.Context, connInfo *ConnInfo) context.Context

Ctx returns a derived context with the given ConnInfo.

Types

type ConnInfo

type ConnInfo struct {
	PeerAddr string

	BypassAuth bool
	// contains filtered or unexported fields
}

ConnInfo represents client connection information.

func Get

func Get(ctx context.Context) *ConnInfo

Get returns the ConnInfo value stored in ctx.

func New

func New() *ConnInfo

New returns a new ConnInfo.

func (*ConnInfo) Auth

func (connInfo *ConnInfo) Auth() (username, password string)

Auth returns stored username and password.

func (*ConnInfo) MetadataRecv

func (connInfo *ConnInfo) MetadataRecv() bool

MetadataRecv returns whatever client metadata was received already.

func (*ConnInfo) SetAuth

func (connInfo *ConnInfo) SetAuth(username, password string)

SetAuth stores username and password.

func (*ConnInfo) SetMetadataRecv

func (connInfo *ConnInfo) SetMetadataRecv()

SetMetadataRecv marks client metadata as received.

func (*ConnInfo) Username

func (connInfo *ConnInfo) Username() string

Username returns stored username.

Jump to

Keyboard shortcuts

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