model

package
v0.0.0-...-e70f483 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package model holds model related files

Package model holds model related files

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoImageProvided = errors.New("no image name provided") // ErrNoImageProvided is returned when no image name is provided
)

Functions

func WorkloadSelectorToProto

func WorkloadSelectorToProto(input *WorkloadSelector) *proto.ProfileSelector

WorkloadSelectorToProto incode a WorkloadSelector to its protobuf representation

Types

type CacheEntry

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

CacheEntry cgroup resolver cache entry

func NewCacheEntry

func NewCacheEntry(containerContext model.ContainerContext, cgroupContext model.CGroupContext, pid uint32) *CacheEntry

NewCacheEntry returns a new instance of a CacheEntry

func (*CacheEntry) AddPID

func (cgce *CacheEntry) AddPID(pid uint32) int

AddPID adds a pid to the list of pids

func (*CacheEntry) CGroupContextEquals

func (cgce *CacheEntry) CGroupContextEquals(other *CacheEntry) bool

CGroupContextEquals returns if the cgroups are equal

func (*CacheEntry) CallReleaseCallbacks

func (cgce *CacheEntry) CallReleaseCallbacks()

CallReleaseCallbacks releases the callbacks of the cache entry

func (*CacheEntry) ContainsPID

func (cgce *CacheEntry) ContainsPID(pid uint32) bool

ContainsPID returns whether the cache entry contains the pid

func (*CacheEntry) GetCGroupContext

func (cgce *CacheEntry) GetCGroupContext() model.CGroupContext

GetCGroupContext returns the cgroup context

func (*CacheEntry) GetCGroupID

func (cgce *CacheEntry) GetCGroupID() containerutils.CGroupID

GetCGroupID returns the cgroup ID

func (*CacheEntry) GetCGroupInode

func (cgce *CacheEntry) GetCGroupInode() uint64

GetCGroupInode returns the inode of the cgroup path key

func (*CacheEntry) GetCGroupPathKey

func (cgce *CacheEntry) GetCGroupPathKey() model.PathKey

GetCGroupPathKey returns the cgroup path key

func (*CacheEntry) GetContainerContext

func (cgce *CacheEntry) GetContainerContext() model.ContainerContext

GetContainerID returns the container ID

func (*CacheEntry) GetContainerID

func (cgce *CacheEntry) GetContainerID() containerutils.ContainerID

GetContainerID returns the container ID

func (*CacheEntry) GetPIDs

func (cgce *CacheEntry) GetPIDs() []uint32

GetPIDs returns the list of pids

func (*CacheEntry) IsCGroupContextNull

func (cgce *CacheEntry) IsCGroupContextNull() bool

IsCGroupContextNull returns whether the cgroup context is null

func (*CacheEntry) IsCGroupContextResolved

func (cgce *CacheEntry) IsCGroupContextResolved() bool

IsCGroupContextResolved returns whether the cgroup context is resolved

func (*CacheEntry) IsContainerContextNull

func (cgce *CacheEntry) IsContainerContextNull() bool

IsContainerContextNull returns whether the container context is null

func (*CacheEntry) IsDeleted

func (cgce *CacheEntry) IsDeleted() bool

IsDeleted returns whether the cache entry is deleted

func (*CacheEntry) RemovePID

func (cgce *CacheEntry) RemovePID(pid uint32) int

RemovePID removes the provided pid from the list of pids and return the new size

func (*CacheEntry) RemovePIDs

func (cgce *CacheEntry) RemovePIDs(pids []uint32) int

RemovePIDs removes the pids and return the new size

func (*CacheEntry) SetAsDeleted

func (cgce *CacheEntry) SetAsDeleted()

SetAsDeleted sets the cache entry as deleted

func (*CacheEntry) SetPIDs

func (cgce *CacheEntry) SetPIDs(pids []uint32)

SetPIDs set the pids list

type WorkloadSelector

type WorkloadSelector struct {
	Image string
	Tag   string
}

WorkloadSelector is a selector used to uniquely indentify the image of a workload

func NewWorkloadSelector

func NewWorkloadSelector(image string, tag string) (WorkloadSelector, error)

NewWorkloadSelector returns an initialized instance of a WorkloadSelector

func ProtoToWorkloadSelector

func ProtoToWorkloadSelector(selector *proto.ProfileSelector) WorkloadSelector

ProtoToWorkloadSelector decodes a Selector structure

func (WorkloadSelector) Copy

Copy returns a copy of the selector

func (*WorkloadSelector) IsReady

func (ws *WorkloadSelector) IsReady() bool

IsReady returns true if the selector is ready

func (*WorkloadSelector) Match

func (ws *WorkloadSelector) Match(selector WorkloadSelector) bool

Match returns true if the input selector matches the current selector

func (WorkloadSelector) String

func (ws WorkloadSelector) String() string

String returns a string representation of a workload selector

func (WorkloadSelector) ToTags

func (ws WorkloadSelector) ToTags() []string

ToTags returns a string array representation of a workload selector

Jump to

Keyboard shortcuts

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