Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSerializer ¶
func RegisterSerializer(serializerType string, createFunc func() ISerializer)
RegisterSerializer registers a new serializer with the given name.
Types ¶
type DefaultJSONSerializer ¶
type DefaultJSONSerializer struct { }
DefaultJSONSerializer leverages the default `json` to serialize the items before storing them in the cache
type ISerializer ¶
type ISerializer interface { // Marshal serializes the given value into a byte slice. Marshal(v any) ([]byte, error) // Unmarshal deserializes the given byte slice into the given value. Unmarshal(data []byte, v any) error }
ISerializer is the interface that wraps the basic serializer methods.
func New ¶
func New(serializerType string) (ISerializer, error)
New returns a new serializer based on the serializerType.
type MsgpackSerializer ¶
type MsgpackSerializer struct { }
MsgpackSerializer leverages `msgpack` to serialize the items before storing them in the cache
Click to show internal directories.
Click to hide internal directories.