usm

package
v0.0.0-...-0c9fb3e Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package usm provides functionality to detect the most appropriate service name for a process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectionContext

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

DetectionContext allows to detect ServiceMetadata.

func NewDetectionContext

func NewDetectionContext(logger *zap.Logger, args []string, envs []string, fs fs.SubFS) DetectionContext

NewDetectionContext initializes DetectionContext.

type RealFs

type RealFs struct{}

RealFs implements real fs operations.

func (RealFs) Open

func (RealFs) Open(name string) (fs.File, error)

Open calls os.Open.

func (RealFs) Sub

func (RealFs) Sub(dir string) (fs.FS, error)

Sub calls os.DirFS.

type ServiceMetadata

type ServiceMetadata struct {
	Name            string
	AdditionalNames []string
	FromDDService   bool
}

ServiceMetadata holds information about a service.

func ExtractServiceMetadata

func ExtractServiceMetadata(logger *zap.Logger, args []string, envs []string) (ServiceMetadata, bool)

ExtractServiceMetadata attempts to detect ServiceMetadata from the given process.

func NewServiceMetadata

func NewServiceMetadata(name string, additional ...string) ServiceMetadata

NewServiceMetadata initializes ServiceMetadata.

func (ServiceMetadata) GetServiceKey

func (s ServiceMetadata) GetServiceKey() string

GetServiceKey returns the key for the service.

Jump to

Keyboard shortcuts

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