core

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Epoch = time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC)

Epoch is 01/01/1970.

Functions

func Base64RawStdDecode

func Base64RawStdDecode(value []byte) ([]byte, error)

Base64RawStdDecode base标准解码

func Base64RawStdEncode

func Base64RawStdEncode(value []byte) []byte

Base64RawStdEncode baseRaw标准编码

func Base64RawURLDecode

func Base64RawURLDecode(value []byte) ([]byte, error)

Base64RawURLDecode baseRawURL解码

func Base64RawURLEncode

func Base64RawURLEncode(value []byte) []byte

Base64RawURLEncode baseRawURL编码

func Base64StdDecode

func Base64StdDecode(value []byte) ([]byte, error)

Base64StdDecode base标准解码

func Base64StdEncode

func Base64StdEncode(value []byte) []byte

Base64StdEncode base标准编码

func Base64URLDecode

func Base64URLDecode(value []byte) ([]byte, error)

Base64URLDecode baseURL解码

func Base64URLEncode

func Base64URLEncode(value []byte) []byte

Base64URLEncode baseURL编码

func JwtHS

func JwtHS(alg string) (func(key []byte) hash.Hash, error)

Types

type LocalMessageInterface added in v1.4.2

type LocalMessageInterface interface {
	Local(string) string
}

type SecretKeyFormatType

type SecretKeyFormatType int
const (
	PKCS8 SecretKeyFormatType = 1
	PKCS1 SecretKeyFormatType = 2
)

func SecretKeyFormatTypeParse

func SecretKeyFormatTypeParse(v int) SecretKeyFormatType

type SecretKeyLengthType

type SecretKeyLengthType int
const (
	RSA SecretKeyLengthType = 1
	M2  SecretKeyLengthType = 2
)

func SecretKeyLengthTypeParse

func SecretKeyLengthTypeParse(v int) SecretKeyLengthType

type Time

type Time struct {
	time.Time
}

Time is the allowed format for time, as per the RFC 7519.

func NewTime

func NewTime(t time.Time) *Time

func Now

func Now() Time

func NumericDate

func NumericDate(tt time.Time) *Time

NumericDate is a resolved Unix time.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements a marshaling function for time-related claims.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON implements an unmarshaling function for time-related claims.

Jump to

Keyboard shortcuts

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