v5

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonPayload

type CommonPayload struct {
	common.Payload
}

CommonPayload wraps Payload from the common package

type GohaiPayload

type GohaiPayload struct {
	Marshalled MarshalledGohaiPayload `json:"gohai"`
}

GohaiPayload wraps Payload from the gohai package As weird as it sounds, in the v5 payload the value of the "gohai" field is a JSON-formatted string. So this struct contains a MarshalledGohaiPayload which will be marshalled as a JSON-formatted string.

type HostPayload

type HostPayload struct {
	host.Payload
}

HostPayload wraps Payload from the host package

type MarshalledGohaiPayload

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

MarshalledGohaiPayload contains the marshalled payload

func (MarshalledGohaiPayload) MarshalJSON

func (m MarshalledGohaiPayload) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. It marshals the gohai struct twice (to a string) to comply with the v5 payload format

func (*MarshalledGohaiPayload) UnmarshalJSON

func (m *MarshalledGohaiPayload) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. Unmarshals the passed bytes twice (first to a string, then to gohai.Gohai)

type Payload

Payload handles the JSON unmarshalling of the metadata payload

func GetPayload

func GetPayload(hostnameData util.HostnameData) *Payload

GetPayload returns the complete metadata payload as seen in Agent v5

func (*Payload) Marshal

func (p *Payload) Marshal() ([]byte, error)

Marshal not implemented

func (*Payload) MarshalJSON

func (p *Payload) MarshalJSON() ([]byte, error)

MarshalJSON serialization a Payload to JSON

func (*Payload) MarshalSplitCompress

func (p *Payload) MarshalSplitCompress(bufferContext *marshaler.BufferContext) ([]*[]byte, error)

MarshalSplitCompress not implemented

func (*Payload) SplitPayload

func (p *Payload) SplitPayload(times int) ([]marshaler.Marshaler, error)

SplitPayload breaks the payload into times number of pieces

type ResourcesPayload

type ResourcesPayload struct {
	resources.Payload `json:"resources,omitempty"`
}

ResourcesPayload wraps Payload from the resources package

Jump to

Keyboard shortcuts

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