managers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package managers implements some core utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString is a helper function

func DefaultAppName

func DefaultAppName() string

DefaultAppName gets the name of the current executable

func GetAppName

func GetAppName(ctx context.Context) string

GetAppName fetches the appname key value

func GetCurrentTime

func GetCurrentTime(ctx context.Context) time.Time

GetCurrentTime returns the current time from the context or default

func GetRandFloat64

func GetRandFloat64(ctx context.Context) float64

GetRandFloat64 returns a random float64

func GetRandIntn

func GetRandIntn(ctx context.Context, n int) int

GetRandIntn returns a random int

func GetRandomBytes

func GetRandomBytes(ctx context.Context, n int) []byte

GetRandomBytes returns n random bytes

func NewAPIHandlers

func NewAPIHandlers()

NewAPIHandlers - handle new api

func NewDefaultContext

func NewDefaultContext(parent context.Context) context.Context

NewDefaultContext provides a default context for applications.

func RemoveString

func RemoveString(slice []string, s string) (result []string)

RemoveString is a helper function

func SetDefaultLogLevel

func SetDefaultLogLevel(l zerolog.Level)

SetDefaultLogLevel sets the default log level

func StartHTTPServer

func StartHTTPServer()

StartHTTPServer - start a web server on the specified port.

func StartMetricServer

func StartMetricServer()

StartMetricServer - Start serving Metric Server

func WithAppName

func WithAppName(parent context.Context, appName string) context.Context

WithAppName returns a context with the specified app name

func WithClock

func WithClock(parent context.Context, clockFunc func() time.Time) context.Context

WithClock gets a context with a clock func

func WithDefaultLogger

func WithDefaultLogger(parent context.Context) context.Context

WithDefaultLogger returns a context with the default logger

func WithRandomSeed

func WithRandomSeed(parent context.Context, seed int64) context.Context

WithRandomSeed sets a seed

func WithSignalHandler

func WithSignalHandler(parent context.Context) context.Context

WithSignalHandler returns a context with signal handlers

Types

type Manager

type Manager struct {
	//nolint
	API  *managerapi.ManagerAPI
	Data *managerapi.ManagerData
	Conf *managerapi.ManagerConf
}

Manager - Access to all APIs/data/conf in a single struct

var ManagerAccess *Manager

ManagerAccess - access to manager struct

func NewInstance

func NewInstance(superforge *elektratypes.Elektra) (*Manager, error)

NewInstance - new instance with the parent datastruct

func (*Manager) Bootstrap

func (m *Manager) Bootstrap() *bootstrap.BoostrapAPI

Bootstrap Add bootstrap manager instance here

func (*Manager) Carbide

func (m *Manager) Carbide() *carbide.API

Carbide manager instance here

func (*Manager) DpuExtensionService

func (m *Manager) DpuExtensionService() *dpuextensionservice.API

DpuExtensionService - Add DPU Extension Service Manager instance here

func (*Manager) ExpectedMachine

func (m *Manager) ExpectedMachine() *expectedmachine.API

ExpectedMachine - Add ExpectedMachine Manager instance here

func (*Manager) ExpectedPowerShelf

func (m *Manager) ExpectedPowerShelf() *expectedpowershelf.API

ExpectedPowerShelf - Add ExpectedPowerShelf Manager instance here

func (*Manager) ExpectedSwitch

func (m *Manager) ExpectedSwitch() *expectedswitch.API

ExpectedSwitch - Add ExpectedSwitch Manager instance here

func (*Manager) Health

func (m *Manager) Health() *health.API

Health - Add Health Manager instance here

func (*Manager) InfiniBandPartition

func (m *Manager) InfiniBandPartition() *infinibandpartition.API

InfiniBandPartition - Add InfiniBandPartition Manager instance here

func (*Manager) Init

func (Managers *Manager) Init()

Init - initialize all the mgrs

func (*Manager) Instance

func (m *Manager) Instance() *instance.API

Instance - Add Instance Manager instance here

func (*Manager) InstanceType

func (m *Manager) InstanceType() *instancetype.API

InstanceType - Add InstanceType Manager instance here

func (*Manager) Machine

func (m *Manager) Machine() *machine.API

Machine - Add Machine manager instance here

func (*Manager) MachineValidation

func (m *Manager) MachineValidation() *machinevalidation.API

MachineValidation - Add MachineValidation Manager instance here

func (*Manager) NVLinkLogicalPartition

func (m *Manager) NVLinkLogicalPartition() *nvlinklogicalpartition.API

NVLinkLogicalPartition - Add NVLinkLogicalPartition Manager instance here

func (*Manager) NetworkSecurityGroup

func (m *Manager) NetworkSecurityGroup() *networksecuritygroup.API

NetworkSecurityGroup - Add NetworkSecurityGroup Manager instance here

func (*Manager) NewInstance

func (Managers *Manager) NewInstance()

NewInstance - instantiates all the managers

func (*Manager) OperatingSystem

func (m *Manager) OperatingSystem() *operatingsystem.API

OperatingSystem - Add OperatingSystem Manager instance here

func (*Manager) Orchestrator

func (m *Manager) Orchestrator() *workflow.API

Orchestrator - Add orchestrator manager instance here

func (*Manager) RLA

func (m *Manager) RLA() *rla.API

RLA - Add RLA Manager instance here

func (*Manager) SKU

func (m *Manager) SKU() *sku.API

SKU - Add SKU Manager instance here

func (*Manager) SSHKeyGroup

func (m *Manager) SSHKeyGroup() *sshkeygroup.API

SSHKeyGroup - Add SSHKeyGroup Manager instance here

func (*Manager) Start

func (Managers *Manager) Start()

Start - start the mgrs

func (*Manager) Subnet

func (m *Manager) Subnet() *subnet.API

Subnet - Add Subnet Manager instance here

func (*Manager) Tenant

func (m *Manager) Tenant() *tenant.API

Tenant - Add Tenant Manager instance here

func (*Manager) VPC

func (m *Manager) VPC() *vpc.API

VPC - Add vpc manager instance here

func (*Manager) VpcPrefix

func (m *Manager) VpcPrefix() *vpcprefix.API

VpcPrefix - Add vpcprefix manager instance here

type Rand

type Rand struct {
	sync.Mutex
	*rand.Rand
}

Rand wraps *rand.Rand, provides thread-safe access to a subset of methods.

func (*Rand) Float64

func (r *Rand) Float64() float64

Float64 returns a random float64

func (*Rand) Intn

func (r *Rand) Intn(n int) int

Intn returns a random int

func (*Rand) RandomBytes

func (r *Rand) RandomBytes(n int) []byte

RandomBytes returns n random bytes.

Jump to

Keyboard shortcuts

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