server

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 116 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URLPathSwagger     = "/swagger/*any"
	URLPathSwaggerDesc = "Swagger endpoint for docs"
)
View Source
const (
	URLPathHealthz     = "/healthz"
	URLPathHealthzDesc = "Get the health status of the gpud instance"
)
View Source
const (
	URLPathConfig     = "/config"
	URLPathConfigDesc = "Get the configuration of the gpud instance"
)
View Source
const (
	URLPathPackages     = "/packages"
	URLPathPackagesDesc = "Get the status of gpud managed packages"
)
View Source
const (
	RequestHeaderContentType = "Content-Type"
	RequestHeaderJSON        = "application/json"
	RequestHeaderYAML        = "application/yaml"
	RequestHeaderJSONIndent  = "json-indent"

	RequestHeaderAcceptEncoding = "Accept-Encoding"
	RequestHeaderEncodingGzip   = "gzip"
)
View Source
const (
	URLPathComponents     = "/components"
	URLPathComponentsDesc = "Get the list of all components"
)
View Source
const (
	URLPathStates     = "/states"
	URLPathStatesDesc = "Get the states of all gpud components"
)
View Source
const (
	URLPathEvents     = "/events"
	URLPathEventsDesc = "Get the events of all gpud components"
)
View Source
const (
	URLPathInfo     = "/info"
	URLPathInfoDesc = "Get the information of all gpud components"
)
View Source
const (
	URLPathMetrics     = "/metrics"
	URLPathMetricsDesc = "Get the metrics of all gpud components"
)
View Source
const DefaultQuerySince = 30 * time.Minute

Variables

View Source
var DefaultHealthz = Healthz{
	Status:  "ok",
	Version: "v1",
}

Functions

func WriteToken

func WriteToken(token string, fifoFile string) error

Types

type Healthz

type Healthz struct {
	Status  string `json:"status"`
	Version string `json:"version"`
}

func (Healthz) JSON

func (hz Healthz) JSON() ([]byte, error)

type Server

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

Server is the gpud main daemon

func New

func New(ctx context.Context, config *lepconfig.Config, endpoint string, cliUID string, packageManager *manager.Manager, opts ...gpud_config.OpOption) (_ *Server, retErr error)

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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