jwt

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 3 Imported by: 0

README

Ssi Core / JWT

This package provides a simple JWT implementation.

Usage

package main

import (
    "github.com/ssibrahimbas/ssi-core/pkg/jwt"
    "github.com/ssibrahimbas/ssi-core/pkg/auth"
    "github.com/ssibrahimbas/ssi-core/pkg/helper"
    "fmt"
)

func main() {
    // Create a new JWT instance with the secret key
    j := jwt.New("secret")
    u := &auth.CurrentUser{
        Id: "123",
        Email: "info@ssibrahimbas.com"
    }
    t, err := j.Sign(u)
    helper.CheckErr(err)
    fmt.Println(t)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jwt

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

func New

func New(s string) *Jwt

func (*Jwt) Parse

func (j *Jwt) Parse(t string) (*jwt.Token, error)

func (*Jwt) Sign

func (j *Jwt) Sign(p interface{}) (string, error)

Jump to

Keyboard shortcuts

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