handler

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package handler adapts HTTP requests to Bed and Amenity operations.

Index

Constants

View Source
const BedHeader = "X-Hostel-Bed"

BedHeader carries the caller-owned Bed.Name; empty means the default Bed.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DormReadFallbackRoot string
}

type Handler

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

Handler queries domain owners and assembles their results into API views.

func New

func New(mgr *bed.Manager, cfg Config) *Handler

func (*Handler) RegisterRoutes

func (s *Handler) RegisterRoutes(e *gin.Engine)

RegisterRoutes installs the HTTP contract on the supplied engine.

type RunCommandRequest

type RunCommandRequest struct {
	Command    string            `json:"command"`
	Stdin      string            `json:"stdin,omitempty"`
	Cwd        string            `json:"cwd,omitempty"`
	Background bool              `json:"background,omitempty"`
	UID        *int              `json:"uid,omitempty"`
	GID        *int              `json:"gid,omitempty"`
	TimeoutMs  int64             `json:"timeout,omitempty"`
	Envs       map[string]string `json:"envs,omitempty"`
}

RunCommandRequest mirrors execd's shape.

Jump to

Keyboard shortcuts

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