xraydaemonmigration

package
v1.3000030.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

View Source
var GetProcesses = func() ([]Process, error) {
	processList, err := process.Processes()
	if err != nil {
		return nil, err
	}
	var xrayProcesses []Process
	for _, p := range processList {
		curName, err := p.Name()
		if err != nil {
			continue
		}
		if curName == "xray" {
			xrayProcesses = append(xrayProcesses, p)
		}
	}
	return xrayProcesses, nil
}

Process Wrapper function

Functions

func ConvertYamlToJson

func ConvertYamlToJson(yamlData []byte, process Process) (*config.Traces, error)

Converting yaml Data to Json File. Process is needed to get command line arguments.

func FindConfigFile added in v1.300028.0

func FindConfigFile(process Process) (string, error)

Finds config file from cmdline

func GetPathFromArgs

func GetPathFromArgs(argList []string) string

Get the config file path from arguments

Types

type Flag

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

func NewFlag

func NewFlag(name string) *Flag

NewFlag returns a new flag with provided flag name.

func (*Flag) BoolVarF

func (f *Flag) BoolVarF(ptr *bool, name string, shortName string, value bool, usage string)

BoolVarF defines 2 bool flags with specified name and shortName, default value, and usage string. The argument ptr points to a bool variable in which to store the value of the flag.

func (*Flag) IntVarF

func (f *Flag) IntVarF(ptr *int, name string, shortName string, value int, usage string)

IntVarF defines 2 int flags for specified name and shortName with default value, and usage string. The argument ptr points to an int variable in which to store the value of the flag.

func (*Flag) StringVarF

func (f *Flag) StringVarF(ptr *string, name string, shortName string, value string, usage string)

StringVarF defines 2 string flags for specified name and shortName, default value, and usage string. The argument ptr points to a string variable in which to store the value of the flag.

type Process

type Process interface {
	Cwd() (string, error)
	CmdlineSlice() ([]string, error)
	Cmdline() (string, error)
	Terminate() error
}

func FindAllDaemons

func FindAllDaemons() ([]Process, error)

Finds all Daemons and returns their pid

type YamlConfig

type YamlConfig struct {
	TotalBufferSizeMB int    `yaml:"TotalBufferSizeMB"`
	Concurrency       int    `yaml:"Concurrency"`
	Region            string `yaml:"Region"`
	Socket            struct {
		UDPAddress string `yaml:"UDPAddress"`
		TCPAddress string `yaml:"TCPAddress"`
	} `yaml:"Socket"`
	LocalMode    bool   `yaml:"LocalMode"`
	ResourceARN  string `yaml:"ResourceARN"`
	RoleARN      string `yaml:"RoleARN"`
	ProxyAddress string `yaml:"ProxyAddress"`
	Endpoint     string `yaml:"Endpoint"`
	NoVerifySSL  bool   `yaml:"NoVerifySSL"`
}

Daemon Yaml Configuration struct

Jump to

Keyboard shortcuts

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