providers

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAPIError = errors.New("API error")

Functions

func FromMap added in v0.3.0

func FromMap[T any](key string, m map[string]any, must bool) (T, error)

func GetTrimTiers added in v0.3.0

func GetTrimTiers(params map[string]any) (int, error)

func HttpReq

func HttpReq(ctx context.Context, method, url string, headers map[string]string) (string, error)

func ParseInstanceOutput

func ParseInstanceOutput(buff *bytes.Buffer) (map[string]string, error)

func ParsePdshOutput

func ParsePdshOutput(buff *bytes.Buffer, direct bool) (map[string]string, error)

func ReadFile

func ReadFile(path string) (string, error)

func StringFromMap added in v0.3.0

func StringFromMap(key string, m map[string]any, must bool) (string, error)

Types

type Config

type Config struct {
	Creds  map[string]any
	Params map[string]any
}

type Loader

type Loader = component.Loader[Provider, Config]

type NamedLoader

type NamedLoader = component.NamedLoader[Provider, Config]

type Provider

type Provider interface {
	GenerateTopologyConfig(ctx context.Context, pageSize *int, instances []topology.ComputeInstances) (*topology.Vertex, *httperr.Error)
}

type Registry

type Registry component.Registry[Provider, Config]

func NewRegistry

func NewRegistry(namedLoaders ...NamedLoader) Registry

func (Registry) Get

func (r Registry) Get(name string) (Loader, *httperr.Error)

type SimulationParams

type SimulationParams struct {
	ModelFileName string `mapstructure:"modelFileName"`
	APIError      int    `mapstructure:"api_error"`
	TrimTiers     int    `mapstructure:"trimTiers"`
}

func GetSimulationParams

func GetSimulationParams(params map[string]any) (*SimulationParams, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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