arrserver

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package arrserver is the servers a Prowlarr, Sonarr or Radarr calls home to, for a live suite to answer itself: the update server, the clock the application checks its own against, and the notices its makers post.

The applications ask these whether or not anyone asked them to. The update server is asked whenever the health checks run once a build is two weeks old (UpdateCheck in the applications' source), and an answer that cannot be had ends the whole run of checks rather than the one, so a suite that cuts the application off from the internet has to answer it or lose every health check a fortnight after the release it pins. The clock is asked the same way (SystemTimeCheck), and an answer more than a day from the application's own is a health error, so a recording of it is wrong the day after it was made: this one answers with the time it is.

It is an http.Handler for whatever serves the hosts: the applications reach them over HTTPS, so a suite puts it behind the proxy the container is pointed at (test/replayproxy, Proxy.Serve), for the whole host or, where the host's other paths are replayed from a recording, for the one path.

It was written for prowlarr-mcp's suite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is the servers, as one handler. The zero value is not usable; make one with New.

func New

func New() *Server

New is a server that knows of no release, so no update is ever on offer.

func (*Server) Offer

func (s *Server) Offer(updates ...Update)

Offer sets the releases the update server knows of, replacing any it knew.

func (*Server) Report

func (s *Server) Report() string

Report says what a run should fail on at its end, "" for nothing: the requests there was no answer for, which are what an application has started asking that this does not know it asks. It reads as the replay proxy's report of its misses does.

func (*Server) Requests

func (s *Server) Requests() []string

Requests is every request received, in order, as a method and a path.

func (*Server) ServeHTTP

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

ServeHTTP answers the three things the applications ask, under /v1: the newest release above the one asking (update/<branch>), the recent releases (update/<branch>/changes), the time (time) and the notices (notification), of which there are none.

func (*Server) SetDown

func (s *Server) SetDown(down bool)

SetDown makes every answer a 503, the way the services answer when they are not there, or puts them back.

func (*Server) Unknown

func (s *Server) Unknown() []string

Unknown is the requests it had no answer for, which it answered 404: what an application asked that this does not know it asks.

type Update

type Update struct {
	// Version is the release, e.g. "2.7.0.5700".
	Version string
	// Released is when; zero is a day before the server started.
	Released time.Time
	// New and Fixed are its changes, as the release notes list them.
	New   []string
	Fixed []string
}

Update is one release the update server knows of.

Jump to

Keyboard shortcuts

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