basic

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mocks

type Mocks struct{ mock.Mock }

Mocks struct

func (*Mocks) Name

func (m *Mocks) Name() string

Name mocks

func (*Mocks) Sign

func (m *Mocks) Sign(headerPayload []byte) ([]byte, error)

Sign mocks

func (*Mocks) Size

func (m *Mocks) Size() int

Size mocks

func (*Mocks) Verify

func (m *Mocks) Verify(headerPayload, sig []byte) error

Verify mocks

type Token

type Token struct {
	*contract.Token
	// contains filtered or unexported fields
}

Token define a filed to support building basic

func New

func New(token *contract.Token) *Token

New is a function to initialize basic jwt

func (*Token) Sign

func (t *Token) Sign(ctx context.Context, payload *contract.Payload) (string, error)

Sign is a function to signning JWT

func (*Token) Verify

func (t *Token) Verify(ctx context.Context, token string) (*contract.Payload, error)

Verify is a function to verify JWT

Jump to

Keyboard shortcuts

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