userip

package
v0.0.0-...-2824937 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT, BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package userip provides functions for extracting a user IP address from a request and associating it with a Context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) (net.IP, bool)

FromContext extracts the user IP address from ctx, if present.

func FromRequest

func FromRequest(req *http.Request) (net.IP, error)

FromRequest extracts the user IP address from req, if present.

func NewContext

func NewContext(ctx context.Context, userIP net.IP) context.Context

NewContext returns a new Context carrying userIP.

Types

This section is empty.

Jump to

Keyboard shortcuts

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