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

api

package
v1.3.100 Latest Latest
Warning

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

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

Documentation

Overview

Package api pkg/deployment/ut/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

	DmsgServers []string
	// contains filtered or unexported fields
}

API register all the API endpoints. It implements a net/http.Handler.

func New

func New(log logrus.FieldLogger, s store.Store, nonceStore httpauth.NonceStore, locDetails geo.LocationDetails,
	enableLoadTesting, enableMetrics bool, m utmetrics.Metrics, storeDataCutoff int, storeDataPath, dmsgAddr string) *API

New constructs a new API instance.

func (*API) RunBackgroundTasks

func (api *API) RunBackgroundTasks(ctx context.Context, logger logrus.FieldLogger)

RunBackgroundTasks is function which runs periodic background tasks of API.

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,omitempty"`
	DmsgAddr    string          `json:"dmsg_address,omitempty"`
	DmsgServers []string        `json:"dmsg_servers,omitempty"`
}

HealthCheckResponse is struct of /health endpoint

type PrivateAPI

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

PrivateAPI register all the PrivateAPI endpoints. It implements a net/http.Handler.

func NewPrivate

func NewPrivate(log logrus.FieldLogger, s store.Store) *PrivateAPI

NewPrivate constructs a new PrivateAPI instance.

Jump to

Keyboard shortcuts

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