taskclass

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package taskclass provides task class definitions and resource management for different types of tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	Identifier Id                       `yaml:"name"`
	Defaults   gera.Map[string, string] `yaml:"defaults"`
	Vars       gera.Map[string, string] `yaml:"vars"`
	Control    struct {
		Mode controlmode.ControlMode `yaml:"mode"`
	} `yaml:"control"`
	Command          *common.CommandInfo      `yaml:"command"`
	Wants            ResourceWants            `yaml:"wants"`
	Limits           *ResourceLimits          `yaml:"limits"`
	Bind             []channel.Inbound        `yaml:"bind"`
	Properties       gera.Map[string, string] `yaml:"properties"`
	Constraints      []constraint.Constraint  `yaml:"constraints"`
	Connect          []channel.Outbound       `yaml:"connect"`
	UpdatedTimestamp time.Time                `yaml:"-"`
}

↓ We need the roles tree to know *where* to run it and how to *configure* it, but

the following information is enough to run the task even with no environment or
role Class.

func (*Class) Equals

func (c *Class) Equals(other *Class) (response bool)

func (*Class) MarshalYAML

func (c *Class) MarshalYAML() (interface{}, error)

func (*Class) UnmarshalYAML

func (c *Class) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

type Classes

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

func NewClasses

func NewClasses() *Classes

func (*Classes) DeleteKey

func (c *Classes) DeleteKey(key string)

func (*Classes) DeleteKeys

func (c *Classes) DeleteKeys(keys []string)

func (*Classes) Do

func (c *Classes) Do(f func(classMap *map[string]*Class) error) error

func (*Classes) Foreach

func (c *Classes) Foreach(do func(string, *Class) bool)

func (*Classes) GetClass

func (c *Classes) GetClass(key string) (class *Class, ok bool)

func (*Classes) UpdateClass

func (c *Classes) UpdateClass(key string, class *Class)

type Id

type Id struct {
	RepoIdentifier string
	Hash           string
	Name           string
}

func (Id) String

func (tcID Id) String() string

func (*Id) UnmarshalYAML

func (tcID *Id) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

type ResourceLimits added in v0.68.0

type ResourceLimits struct {
	Cpu    *float64 `yaml:"cpu"`
	Memory *float64 `yaml:"memory"`
}

func (*ResourceLimits) UnmarshalYAML added in v0.68.0

func (rw *ResourceLimits) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

type ResourceWants

type ResourceWants struct {
	Cpu    *float64    `yaml:"cpu"`
	Memory *float64    `yaml:"memory"`
	Ports  port.Ranges `yaml:"ports,omitempty"`
}

func (*ResourceWants) UnmarshalYAML

func (rw *ResourceWants) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

Directories

Path Synopsis
Package port provides port range management functionality for task communication, including port range parsing and validation.
Package port provides port range management functionality for task communication, including port range parsing and validation.

Jump to

Keyboard shortcuts

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