jwt

package
v0.0.0-...-6e8831f Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT Imports: 5 Imported by: 3

Documentation

Overview

Package jwt provides a service to create and verify JWT auth tokens for the forum web app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	Create(userID int64) (token string, err error)
	Verify(token string) (userID int64, issuedAt time.Time, err error)
}

Service is a JWT helper service that creates and verifies auth tokens.

func NewService

func NewService(secret string) (Service, error)

NewService creates a new JWT service using the given secret (32-byte hex-encoded).

Jump to

Keyboard shortcuts

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