config

package
v0.0.0-...-9fc8000 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPExpect

func NewHTTPExpect(t AssertLoggerT, baseURL string) *httpexpect.Expect

Types

type AssertLoggerT

type AssertLoggerT interface {
	assert.TestingT
	httpexpect.Logger
}

type ClusterConfig

type ClusterConfig struct {
	Name        string     `validate:"required"`
	Credentials *K8sConfig `validate:"required" yaml:"credentials" mapstructure:"credentials"`
}

type Config

type Config struct {
	TestID      string `yaml:"test_id" validate:"required" mapstructure:"test_id"`
	APIBasePath string `yaml:"api_base_path" validate:"required" mapstructure:"api_base_path"`

	Project ProjectConfig `validate:"required,dive"`
	Cluster ClusterConfig `validate:"required,dive"`

	Mockserver             MockserverConfig `yaml:"mockserver" validate:"required,dive"`
	MockControlUPIServer   MockserverConfig `yaml:"mockControlUPIServer" validate:"required,dive"`
	MockTreatmentUPIServer MockserverConfig `yaml:"mockTreatmentUPIServer" validate:"required,dive"`
	Echoserver             EchoserverConfig `validate:"required,dive"`

	PythonVersions []string `yaml:"python_versions" validate:"required" mapstructure:"python_versions"`

	// Dynamically computed
	Ensemblers EnsemblerConfig `yaml:"ensemblers" validate:"required,dive"`

	// KubeconfigUseLocal specifies whether the test helper should use local Kube config to
	// authenticate to the cluster. The Kube config is assumed to be available at $HOME/.kube/config.
	// If false, the helper will use the cluster credentials config.yaml.
	KubeconfigUseLocal bool   `yaml:"kubeconfig_use_local" default:"false" mapstructure:"kubeconfig_use_local"`
	KubeconfigFilePath string `yaml:"kubeconfig_file_path" default:"" mapstructure:"kubeconfig_file_path"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadFromFiles

func LoadFromFiles(filepaths ...string) (*Config, error)

func (Config) String

func (c Config) String() string

type EchoserverConfig

type EchoserverConfig struct {
	Image string `validate:"required"`
}

type EnsemblerConfig

type EnsemblerConfig struct {
	BaseName string `yaml:"base_name" validate:"required" mapstructure:"base_name"`
	Entities []EnsemblerData
}

type EnsemblerData

type EnsemblerData struct {
	PythonVersion string
	EnsemblerID   int
}

type K8sConfig

type K8sConfig mlpcluster.K8sConfig

func (*K8sConfig) MarshalYAML

func (k *K8sConfig) MarshalYAML() (interface{}, error)

MarshalYAML implements the Marshal interface, so k8sConfig fields can be properly marshalled

func (*K8sConfig) UnmarshalYAML

func (k *K8sConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements Unmarshal interface Since K8sConfig fields only have json tags, sigyaml.Unmarshal needs to be used to unmarshal all the fields. This method reads K8sConfig into a map[string]interface{}, marshals it into a byte for, before passing to sigyaml.Unmarshal

type MockserverConfig

type MockserverConfig struct {
	Image      string `validate:"required"`
	ServerName string `yaml:"name" validate:"required" mapstructure:"name"`
	Endpoint   string `yaml:"endpoint" mapstructure:"endpoint"`
}

type ProjectConfig

type ProjectConfig struct {
	ID   int
	Name string `validate:"required"`
}

Jump to

Keyboard shortcuts

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