auth

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

Creates a new Namespace and returns a new internal.FuncsNamespace

Types

type Namespace

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

Namespace defines the methods for auth to be used as template functions.

func New

Creates a new auth Namespace

func (*Namespace) Admin

func (ns *Namespace) Admin() bool

Admin

If the user is authenticated (logged in) & an admin user. Returns false if the cookie was not found or not authenticated.

Example: {{ admin }}

func (*Namespace) Auth

func (ns *Namespace) Auth() bool

Auth

If the user is authenticated (logged in). Return false if the cookie was not found or not authenticated.

Example: {{ auth }}

Jump to

Keyboard shortcuts

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