Documentation
¶
Index ¶
Constants ¶
View Source
const (
DateTimeFMT = "2006-01-02T15:04:05.000Z"
)
Variables ¶
View Source
var ( EmailEmptyErr = errors.New("error creating session email required but was empty") StartEmptyErr = errors.New("error unmarshalling session start field required but was missing/empty") LastAccessedEmptyErr = errors.New("error unmarshalling session last accessed field required but was missing/empty") )
Functions ¶
Types ¶
type NewSessionDetails ¶
type NewSessionDetails struct {
Email string `json:"email"`
}
NewSessionDetails is the create HTTP request body required to creating new session
type Session ¶
type Session struct { ID string `json:"id"` Email string `json:"email"` Start time.Time `json:"start"` LastAccessed time.Time `json:"last_accessed"` }
Session defines the structure required for a session
func New ¶ added in v1.1.0
New construct a new fully populated session object for the provided email. Returns session.EmailEmptyErr if the email is empty/blank, returns an error if a new session ID could not be generated.
func (*Session) MarshalJSON ¶
MarshalJSON is a custom JSON marshaller for Session objects. Handles marshalling time.Time fields into the expected date time format
func (*Session) UnmarshalJSON ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.