wire

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package wire is the public representation of what Arnakoff answers: a report and the list of sources, as the contract api/openapi.yaml describes them. The HTTP API and the MCP server share it, so that both answer with the same fields and the same wording.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidInput

func InvalidInput(k domain.Kind) string

InvalidInput returns why an input of kind k, KindAuto when it was detected, is refused.

Types

type Report

type Report struct {
	Input     string        `json:"input"`
	Type      string        `json:"type"`
	CheckedAt string        `json:"checked_at"`
	Summary   *string       `json:"summary"`
	Signals   []Signal      `json:"signals"`
	Sources   []SourceState `json:"sources"`
}

Report is a report as the contract's Report schema describes it.

func ReportOf

func ReportOf(k domain.Kind, r domain.Report) Report

ReportOf returns the representation of r, the report of an input of kind k.

type Signal

type Signal struct {
	Code       string `json:"code"`
	Level      string `json:"level"`
	Message    string `json:"message"`
	Advice     string `json:"advice,omitempty"`
	Source     string `json:"source"`
	SourceURL  string `json:"source_url"`
	ObservedAt string `json:"observed_at"`
}

Signal is a signal as the contract's Signal schema describes it.

type Source

type Source struct {
	Name      string  `json:"name"`
	Publisher string  `json:"publisher"`
	Licence   string  `json:"licence"`
	URL       string  `json:"url"`
	Status    string  `json:"status"`
	UpdatedAt *string `json:"updated_at"`
	Entries   *int    `json:"entries"`
}

Source is a source as the contract's Source schema describes it. UpdatedAt and Entries are null for a source that is not synced.

type SourceList

type SourceList struct {
	Sources []Source `json:"sources"`
}

SourceList is the list of sources, the contract's SourceList.

func SourcesOf

func SourcesOf(listed []app.ListedSource) SourceList

SourcesOf returns the list of the sources listed, in their order.

type SourceState

type SourceState struct {
	Source string `json:"source"`
	Status string `json:"status"`
}

SourceState is a source state as the contract's SourceState schema describes it.

Jump to

Keyboard shortcuts

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