interlink

package
v0.0.0-...-a69401a Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTracer

func InitTracer(ctx context.Context) (func(context.Context) error, error)

func SetDurationSpan

func SetDurationSpan(startTime int64, span trace.Span, opts ...SpanOption)

func SetupTelemetry

func SetupTelemetry(ctx context.Context) (*sdktrace.TracerProvider, error)

Types

type Config

type Config struct {
	InterlinkAddress  string `yaml:"InterlinkAddress"`
	Interlinkport     string `yaml:"InterlinkPort"`
	Sidecarurl        string `yaml:"SidecarURL"`
	Sidecarport       string `yaml:"SidecarPort"`
	ExportPodData     bool   `yaml:"ExportPodData"`
	VerboseLogging    bool   `yaml:"VerboseLogging"`
	ErrorsOnlyLogging bool   `yaml:"ErrorsOnlyLogging"`
	DataRootFolder    string `yaml:"DataRootFolder"`
}

Config holds the whole configuration

func NewInterLinkConfig

func NewInterLinkConfig() (Config, error)

NewInterLinkConfig returns a variable of type InterLinkConfig, used in many other functions and the first encountered error.

type ContainerLogOpts

type ContainerLogOpts struct {
	Tail         int       `json:"Tail"`
	LimitBytes   int       `json:"Bytes"`
	Timestamps   bool      `json:"Timestamps"`
	Follow       bool      `json:"Follow"`
	Previous     bool      `json:"Previous"`
	SinceSeconds int       `json:"SinceSeconds"`
	SinceTime    time.Time `json:"SinceTime"`
}

ContainerLogOpts is a struct in which it is possible to specify options to retrieve logs from the sidecar

type CreateStruct

type CreateStruct struct {
	PodUID string `json:"PodUID"`
	PodJID string `json:"PodJID"`
}

CreateStruct is the response to be received from interLink whenever asked to create a pod. It will allow for mapping remote ID with the pod UUID

type LogStruct

type LogStruct struct {
	Namespace     string           `json:"Namespace"`
	PodUID        string           `json:"PodUID"`
	PodName       string           `json:"PodName"`
	ContainerName string           `json:"ContainerName"`
	Opts          ContainerLogOpts `json:"Opts"`
}

LogStruct is needed to identify the job/container running on the sidecar to retrieve the logs from. Using ContainerLogOpts struct allows to specify more options on how to collect logs

type PodCreateRequests

type PodCreateRequests struct {
	Pod        v1.Pod         `json:"pod"`
	ConfigMaps []v1.ConfigMap `json:"configmaps"`
	Secrets    []v1.Secret    `json:"secrets"`
}

PodCreateRequests is a struct holding data for a create request. Retrieved ConfigMaps and Secrets are held along the Pod description itself.

type PodStatus

type PodStatus struct {
	PodName      string               `json:"name"`
	PodUID       string               `json:"UID"`
	PodNamespace string               `json:"namespace"`
	JobID        string               `json:"JID"`
	Containers   []v1.ContainerStatus `json:"containers"`
}

PodStatus is a simplified v1.Pod struct, holding only necessary variables to uniquely identify a job/service in the sidecar. It is used to request

type RetrievedContainer

type RetrievedContainer struct {
	Name       string         `json:"name"`
	ConfigMaps []v1.ConfigMap `json:"configMaps"`
	Secrets    []v1.Secret    `json:"secrets"`
	EmptyDirs  []string       `json:"emptyDirs"`
}

RetrievedContainer is used in InterLink to rearrange data structure in a suitable way for the sidecar

type RetrievedPodData

type RetrievedPodData struct {
	Pod        v1.Pod               `json:"pod"`
	Containers []RetrievedContainer `json:"container"`
}

RetrievedPoData is used in InterLink to rearrange data structure in a suitable way for the sidecar

type SpanConfig

type SpanConfig struct {
	HTTPReturnCode int
	SetHTTPCode    bool
}

type SpanOption

type SpanOption func(*SpanConfig)

func WithHTTPReturnCode

func WithHTTPReturnCode(code int) SpanOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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