user

package
v0.0.0-...-174ac3b Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(c *context.Context, u *User)

Set sets the currently logged-in user. This is typically used by middleware that handles user authentication.

Types

type User

type User struct {
	Id    string // the unique permanent ID of the user.
	Name  string // the human-readable ID of the user.
	Email string
	Photo string

	FederatedIdentity string
	FederatedProvider string

	// additional, custom Attributes
	Attrs map[string]string
}

User represents a user of the application.

func Current

func Current(c *context.Context) *User

Current returns the currently logged-in user, or nil if the user is not signed in.

func Decode

func Decode(v string) *User

Decode will create a user from a URL Query string.

func (*User) Encode

func (u *User) Encode() string

Encode will encode a user as a URL query string.

Jump to

Keyboard shortcuts

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