request

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigQueryConfig

type BigQueryConfig struct {
	Table                string `json:"table"`
	ServiceAccountSecret string `json:"service_account_secret"`
}

BigQueryConfig defines the configs for logging to BQ

type CreateOrUpdateEnsemblerRequest

type CreateOrUpdateEnsemblerRequest struct {
	models.EnsemblerLike
}

CreateOrUpdateEnsemblerRequest is the request to update or create an ensembler

func (*CreateOrUpdateEnsemblerRequest) UnmarshalJSON

func (r *CreateOrUpdateEnsemblerRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON is a function to unmarshal the json into a go object

type CreateOrUpdateRouterRequest

type CreateOrUpdateRouterRequest struct {
	Environment string        `json:"environment_name" validate:"required"`
	Name        string        `json:"name" validate:"required"`
	Config      *RouterConfig `json:"config" validate:"required,dive"`
}

CreateOrUpdateRouterRequest structure defines the format of the request payload when creating or updating routers

func (CreateOrUpdateRouterRequest) BuildRouter

func (r CreateOrUpdateRouterRequest) BuildRouter(projectID models.ID) *models.Router

BuildRouter builds the router model from the entire request payload

type EnricherEnsemblerConfig

type EnricherEnsemblerConfig struct {
	// Fully qualified docker image string used by the enricher, in the
	// format registry/repository:version.
	Image string `json:"image" validate:"required"`
	// Resource requests  for the deployment of the enricher.
	ResourceRequest *models.ResourceRequest `json:"resource_request" validate:"required"`
	// Autoscaling policy for the enricher / ensembler.
	AutoscalingPolicy *models.AutoscalingPolicy `json:"autoscaling_policy" validate:"omitempty,dive"`
	// Endpoint to query.
	Endpoint string `json:"endpoint" validate:"required"`
	// Request timeout as a valid quantity string.
	Timeout string `json:"timeout" validate:"required"`
	// Port to query.
	Port int `json:"port" validate:"required"`
	// Environment variables to inject into the pod.
	Env models.EnvVars `json:"env" validate:"required"`
	// ServiceAccount specifies the name of the secret registered in the MLP project containing the service account.
	// The service account will be mounted into the user-container and the environment variable
	// GOOGLE_APPLICATION_CREDENTIALS will reference the service account file.
	ServiceAccount string `json:"service_account"`
}

EnricherEnsemblerConfig defines the configs for the enricher / ensembler, used by the specific router config

func (EnricherEnsemblerConfig) BuildEnricher

func (cfg EnricherEnsemblerConfig) BuildEnricher() *models.Enricher

BuildEnricher builds the enricher model from the enricher config

type ExperimentEngineConfig

type ExperimentEngineConfig struct {
	Type   string          `json:"type" validate:"required"`
	Config json.RawMessage `json:"config,omitempty" validate:"-"` // Skip validate to invoke custom validation
}

ExperimentEngineConfig defines the experiment engine config

type KafkaConfig

type KafkaConfig struct {
	Brokers             string                     `json:"brokers"`
	Topic               string                     `json:"topic"`
	SerializationFormat models.SerializationFormat `json:"serialization_format"`
}

KafkaConfig defines the configs for logging to Kafka

type LogConfig

type LogConfig struct {
	ResultLoggerType models.ResultLogger `json:"result_logger_type"`
	BigQueryConfig   *BigQueryConfig     `json:"bigquery_config,omitempty"`
	KafkaConfig      *KafkaConfig        `json:"kafka_config,omitempty"`
}

LogConfig defines the logging configs

type RouterConfig

type RouterConfig struct {
	Routes             models.Routes              `json:"routes" validate:"required"`
	DefaultRouteID     *string                    `json:"default_route_id"`
	DefaultTrafficRule *models.DefaultTrafficRule `json:"default_traffic_rule,omitempty"`
	TrafficRules       models.TrafficRules        `json:"rules" validate:"unique=Name,dive"`
	ExperimentEngine   *ExperimentEngineConfig    `json:"experiment_engine" validate:"required,dive"`
	ResourceRequest    *models.ResourceRequest    `json:"resource_request"`
	AutoscalingPolicy  *models.AutoscalingPolicy  `json:"autoscaling_policy" validate:"omitempty,dive"`
	Timeout            string                     `json:"timeout" validate:"required"`
	Protocol           *routerConfig.Protocol     `json:"protocol"`

	LogConfig *LogConfig `json:"log_config" validate:"required"`

	Enricher  *EnricherEnsemblerConfig `json:"enricher,omitempty" validate:"omitempty,dive"`
	Ensembler *models.Ensembler        `json:"ensembler,omitempty" validate:"omitempty,dive"`
}

RouterConfig defines the properties of the specific router version

func (RouterConfig) BuildExperimentEngineConfig

func (r RouterConfig) BuildExperimentEngineConfig(
	router *models.Router,
	cryptoSvc service.CryptoService,
	expSvc service.ExperimentsService,
) (json.RawMessage, error)

BuildExperimentEngineConfig creates the Experiment config from the given input properties

func (RouterConfig) BuildRouterVersion

func (r RouterConfig) BuildRouterVersion(
	projectName string,
	router *models.Router,
	defaults *config.RouterDefaults,
	cryptoSvc service.CryptoService,
	expSvc service.ExperimentsService,
	ensemblersSvc service.EnsemblersService,
) (rv *models.RouterVersion, err error)

BuildRouterVersion builds the router version model from the entire request payload

Jump to

Keyboard shortcuts

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