2023-04-02 18:54:36 +03:00
|
|
|
package jwt
|
|
|
|
|
2023-09-13 18:24:50 +03:00
|
|
|
import "io"
|
|
|
|
|
2023-04-02 18:54:36 +03:00
|
|
|
// Base64Encoder is an interface that allows to implement custom Base64 encoding
|
|
|
|
// algorithms.
|
|
|
|
type Base64EncodeFunc func(src []byte) string
|
|
|
|
|
|
|
|
// Base64Decoder is an interface that allows to implement custom Base64 decoding
|
|
|
|
// algorithms.
|
|
|
|
type Base64DecodeFunc func(s string) ([]byte, error)
|
|
|
|
|
|
|
|
// JSONEncoder is an interface that allows to implement custom JSON encoding
|
|
|
|
// algorithms.
|
|
|
|
type JSONMarshalFunc func(v any) ([]byte, error)
|
|
|
|
|
|
|
|
// JSONUnmarshal is an interface that allows to implement custom JSON unmarshal
|
|
|
|
// algorithms.
|
|
|
|
type JSONUnmarshalFunc func(data []byte, v any) error
|
2023-09-13 18:24:50 +03:00
|
|
|
|
|
|
|
type JSONDecoder interface {
|
|
|
|
UseNumber()
|
|
|
|
Decode(v any) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type JSONNewDecoderFunc[T JSONDecoder] func(r io.Reader) T
|