peercred

package module
v0.0.0-...-35a0c7b Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: BSD-3-Clause Imports: 6 Imported by: 12 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

peercred

Documentation

Overview

Package peercred maps from a net.Conn to information about the other side of the connection, using various OS-specific facilities.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented      = errors.New("not implemented on " + runtime.GOOS)
	ErrUnsupportedConnType = errors.New("unsupported connection type")
)

Functions

This section is empty.

Types

type Creds

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

Creds are the peer credentials.

func Get

func Get(c net.Conn) (*Creds, error)

Get returns the peer credentials for c.

For unsupported system, the error is ErrNotImplemented.

func (*Creds) PID

func (c *Creds) PID() (pid int, ok bool)

func (*Creds) UserID

func (c *Creds) UserID() (uid string, ok bool)

UserID returns the userid (or Windows SID) that owns the other side of the connection, if known. (ok is false if not known) The returned string is suitable to passing to os/user.LookupId.

Jump to

Keyboard shortcuts

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