httpserver

package
v0.0.0-...-57459dd Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenAPIDocument

func OpenAPIDocument(baseURL string) string

OpenAPIDocument returns the OpenAPI YAML with {{BASE_URL}} replaced.

func OpenAPIDocumentTemplate

func OpenAPIDocumentTemplate() string

OpenAPIDocumentTemplate returns the OpenAPI YAML with the {{BASE_URL}} placeholder.

Types

type Config

type Config struct {
	Addr                   string
	AgentBearerToken       string
	PublicBaseURL          string
	ItinerariesBucket      string
	CommentsBucket         string
	AWSRegion              string
	MaxYAMLBytes           int64
	OSRMBaseURL            string
	RouteMode              string // straight | osrm
	DescopeProjectID       string
	SessionSecret          string
	AllowedEmails          []string // lowercase sign-in ACL (email only)
	AllowedSubs            []string // unused in v1; kept for CSV compat
	OpenAIAPIKey           string
	OpenAIModel            string
	ChatAllowedEmails      []string // lowercase; subset allowed to chat
	ChatAllowedSubs        []string // unused for chat ACL in v1
	ContactEmail           string   // privacy / legal contact (CONTACT_EMAIL)
	GoogleSiteVerification string   // Search Console HTML tag (GOOGLE_SITE_VERIFICATION)
}

Config is runtime configuration for tripmapd.

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig reads configuration from the environment.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the tripmapd HTTP API.

func New

func New(cfg Config, st store.Store) *Server

New builds the HTTP server.

func (*Server) CreateTrip

func (s *Server) CreateTrip(w http.ResponseWriter, r *http.Request, _ api.CreateTripParams)

func (*Server) GetSchema

func (s *Server) GetSchema(w http.ResponseWriter, _ *http.Request)

func (*Server) GetTrip

func (s *Server) GetTrip(w http.ResponseWriter, r *http.Request, id string)

func (*Server) GetTripYAML

func (s *Server) GetTripYAML(w http.ResponseWriter, r *http.Request, id string, params api.GetTripYAMLParams)

func (*Server) GetVersion

func (s *Server) GetVersion(w http.ResponseWriter, r *http.Request, id, versionID string)

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the root handler.

func (*Server) Health

func (s *Server) Health(w http.ResponseWriter, _ *http.Request)

func (*Server) ListTrips

func (s *Server) ListTrips(w http.ResponseWriter, r *http.Request)

func (*Server) ListVersions

func (s *Server) ListVersions(w http.ResponseWriter, r *http.Request, id string)

func (*Server) PatchTrip

func (s *Server) PatchTrip(w http.ResponseWriter, r *http.Request, id string, _ api.PatchTripParams)

func (*Server) PutTripYAML

func (s *Server) PutTripYAML(w http.ResponseWriter, r *http.Request, id string, _ api.PutTripYAMLParams)

func (*Server) ReplaceDayRoutes

func (s *Server) ReplaceDayRoutes(w http.ResponseWriter, r *http.Request, id string, _ api.ReplaceDayRoutesParams)

func (*Server) RestoreVersion

func (s *Server) RestoreVersion(w http.ResponseWriter, r *http.Request, id string, _ api.RestoreVersionParams)

Jump to

Keyboard shortcuts

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