session

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDGenerator

type IDGenerator interface {
	NewID() string
}

IDGenerator interface for creating new IDs

type NewSessionDetails

type NewSessionDetails struct {
	Email string `json:"email"`
}

NewSessionDetails is the structure of the request needed to create a session

type Session

type Session struct {
	ID           string    `json:"id"`
	Email        string    `json:"email"`
	Start        time.Time `json:"start"`
	LastAccessed time.Time `json:"lastAccessed"`
}

Session defines the structure required for a session

func NewSession

func NewSession() *Session

NewSession creates a new session

func (*Session) MarshalJSON

func (s *Session) MarshalJSON() ([]byte, error)

MarshalJSON used to marshal Session object for outgoing requests

func (*Session) Update

func (s *Session) Update(email string) (*Session, error)

UpdateSession updates the session with email parameter

Jump to

Keyboard shortcuts

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