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 Server ¶
type Server struct { Brokers *models.Broker Email services.EmailService Files services.FilesService Integrations services.IntegrationsService Logger *slog.Logger 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) Get ¶ added in v1.2.0
func (s *SessionDataMap) Get(sid uuid.UUID) (int64, bool)
Get safely gets a value from the SessionDataMap.
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.