ingest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 22 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

Overview

Package ingest serves the device-authenticated data path: POST /v1/ingest and GET /v1/files.

Index

Constants

View Source
const MaxConcurrentIngest = 4

MaxConcurrentIngest bounds in-flight ingest requests per server.

View Source
const MaxGlobalPerUser = 2

MaxGlobalPerUser bounds the global slots one user may hold at once.

View Source
const MaxIngestPerDevice = 2

MaxIngestPerDevice bounds in-flight ingest requests per device (one is the daemon's normal case).

Variables

This section is empty.

Functions

func RequireDevice

func RequireDevice(d *db.DB, scope string, lim *httpx.Limiter, next http.Handler) http.Handler

RequireDevice authenticates a device token, then checks scope, protocol version and rate limit (in that order).

Types

type Device

type Device struct {
	TokenID, DeviceID, UserID string
	Scopes                    []string
}

Device is the authenticated caller; every field comes from the token row, never from the request.

func DeviceFrom

func DeviceFrom(ctx context.Context) (Device, bool)

DeviceFrom returns the device placed in ctx by RequireDevice.

type Handler

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

Handler serves the ingest endpoints.

func New

func New(d *db.DB) *Handler

New returns a Handler on d.

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux, lim *httpx.Limiter)

Register mounts the endpoints; both need scope ingest:write.

Jump to

Keyboard shortcuts

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