server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package server implements the application's server API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedirectCookie

func NewRedirectCookie(uri string) *http.Cookie

NewRedirectCookie creates a URL redirection cookie for an anonymous user.

func NewRememberMeCookie

func NewRememberMeCookie(selector, validator string) *http.Cookie

NewRememberMeCookie creates a cookie for when the user checks remember on login.

func NewSessionCookie

func NewSessionCookie(value string) *http.Cookie

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.

func (*Server) Run

func (s *Server) Run()

Run starts the web server.

type SessionDataMap added in v1.1.0

type SessionDataMap map[uuid.UUID]int64

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.

Jump to

Keyboard shortcuts

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