jwt

package
v0.0.0-...-8444db5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSigningKeySize = 2048

Variables

View Source
var (
	ErrEmptyMessage  = errors.New("empty message")
	ErrInvalidClaims = errors.New("invalid claims")
	ErrInvalidUserID = errors.New("invalid user id")
)

Functions

This section is empty.

Types

type MemberClaims

type MemberClaims struct {
	UserID repository.UserID `json:"uid"`
	jwt.StandardClaims
}

type Service

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

func NewService

func NewService(cardLayoutPath, cardFontPath string, cardNicknameLayout TextLayout) *Service

func (*Service) EncodeUserID

func (s *Service) EncodeUserID(img image.Image, id repository.UserID) (*bytes.Buffer, error)

func (*Service) GenerateCard

func (s *Service) GenerateCard(user *repository.User) (image.Image, error)

func (*Service) GenerateSigningKey

func (s *Service) GenerateSigningKey(privateKeyPath string) error

func (*Service) LoadSigningKey

func (s *Service) LoadSigningKey(privateKeyPath string) error

func (*Service) ValidateCard

func (s *Service) ValidateCard(img image.Image) (repository.UserID, error)

type TextLayout

type TextLayout struct {
	FontSize    float64
	AnchorX     float64
	AnchorY     float64
	LineSpacing float64
}

Jump to

Keyboard shortcuts

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