alexedwards / scs

HTTP Session Management for Go
MIT License
2.02k stars 165 forks source link

Automatic gob types registration feature #175

Closed obanoff closed 11 months ago

obanoff commented 11 months ago

Added additional functionality to register types automatically for encoding/decoding, via gob package. Provide developers with a possibility to enable automatic gob types registration by changing SessionManager field AutoTypeRegistration to true (false by default). If enabled (true), upon each call to Put, it will checks whether a value type has been registered and added to SessionManager gobTypes string slice, otherwise gob.Resigter(value) will be called and the value type will be added to gobTypes slice. A bit of comfortability for simple tasks.