flare

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package flare implements helpers to parse a Datadog Agent Flare and fetch its content

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flare

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

Flare contains all the information sent by the Datadog Agent when using the Flare command zipFiles is a mapping between filenames and *zip.File obtained from zip.Reader struct.

* `email`: email provided when creating the flare. * `zipFiles`: map between filenames and their information in the form of a zip.File object * `agentVersion`: the version of the Agent which created the flare. * `hostname`: hostname of the host on which the flare was created. Also the name of the flare root folder.

func ParseRawFlare

func ParseRawFlare(flarePayload api.Payload) (Flare, error)

ParseRawFlare parses the flare payload sent by the Fake Intake into a manageable Flare struct For that it parses the multipart data from the flare request and then parses the flare zip raw content.

func (*Flare) GetAgentVersion

func (flare *Flare) GetAgentVersion() string

GetAgentVersion is a getter for the 'agentVersion' field

func (*Flare) GetEmail

func (flare *Flare) GetEmail() string

GetEmail is a getter for the 'email' field

func (*Flare) GetFile

func (flare *Flare) GetFile(path string) (*zip.File, error)

GetFile returns a *zip.File whose name is 'path' or 'path/'. Returns an error if the file does not exist

func (*Flare) GetFileContent

func (flare *Flare) GetFileContent(path string) (string, error)

GetFileContent gets the content from a file and returns it as a string. Returns an error if the file does not exist

func (*Flare) GetFileInfo

func (flare *Flare) GetFileInfo(path string) (fs.FileInfo, error)

GetFileInfo returns a fs.FileInfo associated to the file whose name is 'path' or 'path/'. Returns an error if the file does not exist

func (*Flare) GetFilenames

func (flare *Flare) GetFilenames() []string

GetFilenames returns all the filenames in the flare archive

func (*Flare) GetHostname

func (flare *Flare) GetHostname() string

GetHostname is a getter for the 'hostname' field

func (*Flare) GetPermission

func (flare *Flare) GetPermission(path string) (os.FileMode, error)

GetPermission returns a fs.FileMode associated to the file whose name is 'path' or 'path/'. Returns an error if the file does not exist

Jump to

Keyboard shortcuts

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