api

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: EPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

Index

Constants

View Source
const (
	BOOTSTRAP_PROPERTY_NAME_REMOTE_API_SERVER_URL              string = "framework.api.server.url"
	BOOTSTRAP_PROPERTY_NAME_LOCAL_JVM_LAUNCH_OPTIONS           string = "galasactl.jvm.local.launch.options"
	BOOTSTRAP_PROPERTY_NAME_LOCAL_JVM_LAUNCH_OPTIONS_SEPARATOR string = " "

	// A uint32 value, says which port will be used when the testcase JVM connects to a Java Debugger.
	BOOTSTRAP_PROPERTY_NAME_LOCAL_JVM_LAUNCH_DEBUG_PORT string = "galasactl.jvm.local.launch.debug.port"
	// When the JVM connects to a Java Debugger, should it :
	// 'listen' on the debug port, waiting for the java debugger to connect,
	// or
	// 'attach' to the debug port, which already has the java debugger set up.
	BOOTSTRAP_PROPERTY_NAME_LOCAL_JVM_LAUNCH_DEBUG_MODE string = "galasactl.jvm.local.launch.debug.mode"
)

Variables

View Source
var (
	RATE_LIMIT_STATUS_CODES_MAP = map[int]struct{}{
		http.StatusServiceUnavailable: {},
		http.StatusTooManyRequests:    {},
	}
)

Functions

func GetBootstrapLocation added in v0.34.0

func GetBootstrapLocation(env spi.Environment, galasaHome spi.GalasaHome, explicitUserBootstrap string) string

func InitialiseAPI

func InitialiseAPI(apiServerUrl string) *galasaapi.APIClient

func InitialiseAuthenticatedAPI

func InitialiseAuthenticatedAPI(apiServerUrl string, bearerToken string) *galasaapi.APIClient

Types

type BootstrapData

type BootstrapData struct {
	// Path - the raw path that a user has given us, either from the command-line
	// option or the GALASA_BOOTSTRAP environment variable.
	Path string

	// URL - The URL on which can be followed to reach the bootstrap contents.
	ApiServerURL string

	// Properties - The properties which are read from the bootstrap
	Properties props.JavaProperties
}

func LoadBootstrap

func LoadBootstrap(
	galasaHome spi.GalasaHome,
	fileSystem spi.FileSystem,
	env spi.Environment,
	bootstrapPath string,
	urlResolutionService UrlResolutionService,
) (*BootstrapData, error)

loadBootstrap - Loads the contents of a bootstrap file into memory. bootstrapPath - Where do we find the bootstrap contents from ? This can be a URL must end in /bootstrap

type CommsRetrier added in v0.39.0

type CommsRetrier interface {
	ExecuteCommandWithRateLimitRetries(commandExecutionFunc func() error) error
}

func NewCommsRetrier added in v0.39.0

func NewCommsRetrier(maxAttempts int, retryBackoffSeconds float64, timeService spi.TimeService) CommsRetrier

type CommsRetrierImpl added in v0.39.0

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

func (*CommsRetrierImpl) ExecuteCommandWithRateLimitRetries added in v0.39.0

func (retrier *CommsRetrierImpl) ExecuteCommandWithRateLimitRetries(
	commandExecutionFunc func() error,
) error

ExecuteCommandWithRateLimitRetries keeps trying until we've tried enough, it worked, or it's failed too many times with rate limit issues.

type RealUrlResolutionService

type RealUrlResolutionService struct {
}

func (*RealUrlResolutionService) Get

get - Gets the string contents from a URL

type UrlResolutionService

type UrlResolutionService interface {
	Get(url string) (string, error)
}

Jump to

Keyboard shortcuts

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