Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v1.3.98 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package api pkg/deployment/conf/api/api.go c4-net-discovery

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	http.Handler
	// contains filtered or unexported fields
}

API represents the api of the stun-list service.

func New

func New(log *logging.Logger, conf Config, domain, dmsgAddr string) *API

New creates a new api. By default, serves the embedded deployment config (deployment.Prod). The domain parameter applies HTTP URL replacements for custom deployments; DMSG addresses are PK-based and don't change.

func (*API) Close

func (a *API) Close()

Close stops API.

type Config

type Config struct {
	StunServers       []string        `json:"stun_servers"`
	SetupNodes        []cipher.PubKey `json:"route_setup_nodes"`
	SurveyWhitelist   []cipher.PubKey `json:"survey_whitelist"`
	TransportSetupPKs []cipher.PubKey `json:"transport_setup"`
}

Config contains the list of stun servers and setup-nodes

type Error

type Error struct {
	Error string `json:"error"`
}

Error is the object returned to the client when there's an error.

type HealthCheckResponse

type HealthCheckResponse struct {
	ServiceName string          `json:"service_name,omitempty"`
	BuildInfo   *buildinfo.Info `json:"build_info,omitempty"`
	StartedAt   time.Time       `json:"started_at"`
	DmsgAddr    string          `json:"dmsg_address,omitempty"`
}

HealthCheckResponse is struct of /health endpoint

Jump to

Keyboard shortcuts

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