model

package
v0.0.0-...-73f4ec9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 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 {
	model.CGroupContext
	model.ContainerContext
	sync.RWMutex
	Deleted *atomic.Bool
	PIDs    map[uint32]bool
}

CacheEntry cgroup resolver cache entry

func NewCacheEntry

func NewCacheEntry(containerID containerutils.ContainerID, cgroupContext *model.CGroupContext, pids ...uint32) (*CacheEntry, error)

NewCacheEntry returns a new instance of a CacheEntry

func (*CacheEntry) AddPID

func (cgce *CacheEntry) AddPID(pid uint32)

AddPID adds a pid to the list of pids

func (*CacheEntry) GetPIDs

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

GetPIDs returns the list of pids for the current workload

func (*CacheEntry) RemovePID

func (cgce *CacheEntry) RemovePID(pid uint32)

RemovePID removes the provided pid from the list of pids

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