Documentation ¶
Overview ¶
Package server implements the application's server API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedirectCookie ¶
NewRedirectCookie creates a URL redirection cookie for an anonymous user.
func NewRememberMeCookie ¶
NewRememberMeCookie creates a cookie for when the user checks remember on login.
func NewSessionCookie ¶
NewSessionCookie creates a session cookie for a logged-in user.
Types ¶
type Key ¶
type Key string
Key is a type alias for a context key.
const UserIDKey Key = "userID"
UserIDKey is the key to identify a user ID.
type Server ¶
type Server struct { Brokers map[int64]*models.Broker Email services.EmailService Files services.FilesService Integrations services.IntegrationsService Repository services.RepositoryService Router *http.ServeMux Scraper scraper.IScraper }
Server is the web application's configuration object.
func NewServer ¶
func NewServer(repo services.RepositoryService) *Server
NewServer creates a Server.
type SessionDataMap ¶ added in v1.1.0
SessionDataMap is a type alias to map UUIDs to int64s.
var SessionData SessionDataMap
SessionData maps a UUID to a user id. It's used to track who is logged in session-wise.
func (SessionDataMap) Load ¶ added in v1.1.0
func (s SessionDataMap) Load(r io.Reader)
Load populates the SessionDataMap from the reader.
func (SessionDataMap) Save ¶ added in v1.1.0
func (s SessionDataMap) Save(w io.Writer)
Save saves the SessionDataMap to the writer in the CSV format.