daemon

package
v0.0.0-...-2ae3236 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package daemon implements the fleet long running daemon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Message string `json:"message"`
}

APIError is an error response.

type APIResponse

type APIResponse struct {
	Error *APIError `json:"error,omitempty"`
}

APIResponse is the response to an API request.

type APMInjectionStatus

type APMInjectionStatus struct {
	HostInstrumented   bool `json:"host_instrumented"`
	DockerInstalled    bool `json:"docker_installed"`
	DockerInstrumented bool `json:"docker_instrumented"`
}

APMInjectionStatus contains the instrumentation status of the APM injection.

type Daemon

type Daemon interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error

	SetCatalog(c catalog)
	Install(ctx context.Context, url string, args []string) error
	StartExperiment(ctx context.Context, url string) error
	StopExperiment(ctx context.Context, pkg string) error
	PromoteExperiment(ctx context.Context, pkg string) error
	StartConfigExperiment(ctx context.Context, pkg string, hash string) error
	StopConfigExperiment(ctx context.Context, pkg string) error
	PromoteConfigExperiment(ctx context.Context, pkg string) error

	GetPackage(pkg string, version string) (Package, error)
	GetState() (map[string]repository.State, error)
	GetRemoteConfigState() *pbgo.ClientUpdater
	GetAPMInjectionStatus() (APMInjectionStatus, error)
}

Daemon is the fleet daemon in charge of remote install, updates and configuration.

func NewDaemon

func NewDaemon(hostname string, rcFetcher client.ConfigFetcher, config config.Reader) (Daemon, error)

NewDaemon returns a new daemon.

type LocalAPI

type LocalAPI interface {
	Start(context.Context) error
	Stop(context.Context) error
}

LocalAPI is the interface for the locally exposed API to interact with the daemon.

func NewLocalAPI

func NewLocalAPI(daemon Daemon, runPath string) (LocalAPI, error)

NewLocalAPI returns a new LocalAPI.

type LocalAPIClient

type LocalAPIClient interface {
	Status() (StatusResponse, error)

	SetCatalog(catalog string) error
	Install(pkg, version string) error
	StartExperiment(pkg, version string) error
	StopExperiment(pkg string) error
	PromoteExperiment(pkg string) error
	StartConfigExperiment(pkg, version string) error
	StopConfigExperiment(pkg string) error
	PromoteConfigExperiment(pkg string) error
}

LocalAPIClient is a client to interact with the locally exposed daemon API.

func NewLocalAPIClient

func NewLocalAPIClient(runPath string) LocalAPIClient

NewLocalAPIClient returns a new LocalAPIClient.

type Package

type Package struct {
	Name     string `json:"package"`
	Version  string `json:"version"`
	SHA256   string `json:"sha256"`
	URL      string `json:"url"`
	Size     int64  `json:"size"`
	Platform string `json:"platform"`
	Arch     string `json:"arch"`
}

Package represents a downloadable package.

type StatusResponse

type StatusResponse struct {
	APIResponse
	Version            string                      `json:"version"`
	Packages           map[string]repository.State `json:"packages"`
	ApmInjectionStatus APMInjectionStatus          `json:"apm_injection_status"`
	RemoteConfigState  []*pbgo.PackageState        `json:"remote_config_state"`
}

StatusResponse is the response to the status endpoint.

Jump to

Keyboard shortcuts

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