mdathome

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const ClientSpecification int = 30

ClientSpecification is the integer version of the official specification this client is supposed to work against

Variables

View Source
var ClientVersion string

ClientVersion is the description of the version of the working branch when compiled

Functions

func ShrinkDatabase

func ShrinkDatabase()

ShrinkDatabase initialises and shrinks the MD@Home database

func StartServer

func StartServer()

StartServer starts the MD@Home client

Types

type ClientSettings

type ClientSettings struct {
	APIBackend                string `json:"api_backend"`
	CacheDirectory            string `json:"cache_directory"`
	ClientPort                int    `json:"client_port"`
	OverridePortReport        int    `json:"override_port_report"`
	OverrideAddressReport     string `json:"override_address_report"`
	ClientSecret              string `json:"client_secret"`
	GracefulShutdownInSeconds int    `json:"graceful_shutdown_in_seconds"`

	MaxKilobitsPerSecond       int `json:"max_kilobits_per_second"`
	MaxCacheSizeInMebibytes    int `json:"max_cache_size_in_mebibytes"`
	MaxReportedSizeInMebibytes int `json:"max_reported_size_in_mebibytes"`

	CacheScanIntervalInSeconds int `json:"cache_scan_interval_in_seconds"`
	CacheRefreshAgeInSeconds   int `json:"cache_refresh_age_in_seconds"`
	MaxCacheScanTimeInSeconds  int `json:"max_cache_scan_time_in_seconds"`

	AllowHTTP2              bool   `json:"allow_http2"`
	AllowUpstreamPooling    bool   `json:"allow_upstream_pooling"`
	AllowVisitorRefresh     bool   `json:"allow_visitor_refresh"`
	EnablePrometheusMetrics bool   `json:"enable_prometheus_metrics"`
	MaxMindLicenseKey       string `json:"maxmind_license_key"`
	OverrideUpstream        string `json:"override_upstream"`
	RejectInvalidTokens     bool   `json:"reject_invalid_tokens"`
	VerifyImageIntegrity    bool   `json:"verify_image_integrity"`
	LowMemoryMode           bool   `json:"low_memory_mode"`

	LogLevel              string `json:"log_level"`
	MaxLogSizeInMebibytes int    `json:"max_log_size_in_mebibytes"`
	MaxLogBackups         int    `json:"max_log_backups"`
	MaxLogAgeInDays       int    `json:"max_log_age_in_days"`
}

ClientSettings stores client settings

type ServerRequest

type ServerRequest struct {
	Secret string `json:"secret"`
}

ServerRequest stores a single `secret` field for miscellanous operations

type ServerResponse

type ServerResponse struct {
	ImageServer   string  `json:"image_server"`
	LatestBuild   int     `json:"latest_build"`
	URL           string  `json:"url"`
	TokenKey      string  `json:"token_key"`
	Compromised   bool    `json:"compromised"`
	Paused        bool    `json:"paused"`
	DisableTokens bool    `json:"disable_tokens"`
	TLS           TLSCert `json:"tls"`
}

ServerResponse stores a representation of the response given by the `/ping` backend

type ServerSettings

type ServerSettings struct {
	Secret       string  `json:"secret"`
	Port         int     `json:"port"`
	IPAddress    string  `json:"ip_address,omitempty"`
	DiskSpace    int     `json:"disk_space"`
	NetworkSpeed int     `json:"network_speed"`
	BuildVersion int     `json:"build_version"`
	TLSCreatedAt *string `json:"tls_created_at"`
}

ServerSettings stores server settings

type TLSCert

type TLSCert struct {
	CreatedAt   string `json:"created_at"`
	PrivateKey  string `json:"private_key"`
	Certificate string `json:"certificate"`
}

TLSCert stores a representation of the TLS certificate issued by the API server

type Token

type Token struct {
	Expires string `json:"expires"`
	Hash    string `json:"hash"`
}

Token stores a representation of a token hash issued by the backend

Jump to

Keyboard shortcuts

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