types

package
v0.0.0-...-fd5fce8 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithOpts

func WithOpts[T any, O ~func(*T) error](t *T, opts ...O) error

Types

type ContainerImages

type ContainerImages[T string | ImageRef] struct {
	APIServer         T `mapstructure:"apiserver_image"`
	Orchestrator      T `mapstructure:"orchestrator_image"`
	UI                T `mapstructure:"ui_image"`
	UIBackend         T `mapstructure:"uibackend_image"`
	Scanner           T `mapstructure:"scanner_image"`
	CRDiscoveryServer T `mapstructure:"cr_discovery_server_image"`
	PluginKics        T `mapstructure:"plugin_kics_image"`
}

func NewContainerImages

func NewContainerImages[T string | ImageRef](images map[string]string) (*ContainerImages[T], error)

func (ContainerImages[T]) AsSlice

func (t ContainerImages[T]) AsSlice() []T

func (ContainerImages[T]) AsStringSlice

func (t ContainerImages[T]) AsStringSlice() ([]string, error)

type Endpoints

type Endpoints struct {
	API       *url.URL
	UIBackend *url.URL
}

func (*Endpoints) SetAPI

func (e *Endpoints) SetAPI(scheme, host, port, path string)

func (*Endpoints) SetUIBackend

func (e *Endpoints) SetUIBackend(scheme, host, port, path string)

type Environment

type Environment interface {
	// SetUp the test environment by installing the necessary components.
	// Returns error if it fails to set up the environment.
	SetUp(ctx context.Context) error
	// TearDown the test environment by uninstalling components installed via Setup.
	// Returns error if it fails to clean up the environment.
	TearDown(ctx context.Context) error
	// ServicesReady returns bool based on the health status of the services.
	// Returns error if it fails to determine health status for services.
	ServicesReady(ctx context.Context) (bool, error)
	// ServiceLogs writes service logs to io.Writer for list of services from startTime timestamp.
	// Returns error if it cannot retrieve logs.
	ServiceLogs(ctx context.Context, services []string, startTime time.Time, stdout, stderr io.Writer) error
	// Services returns a list of services for the environment.
	Services(ctx context.Context) (Services, error)
	// Endpoints returns an Endpoints object containing API endpoints for services
	Endpoints(ctx context.Context) (*Endpoints, error)
	// Context updates the provided ctx with environment specific data like with initialized client data allowing tests
	// to interact with the underlying infrastructure.
	Context(ctx context.Context) (context.Context, error)
}

type EnvironmentType

type EnvironmentType string
const (
	EnvironmentTypeDocker     EnvironmentType = "docker"
	EnvironmentTypeKubernetes EnvironmentType = "kubernetes"
	EnvironmentTypeAWS        EnvironmentType = "aws"
	EnvironmentTypeGCP        EnvironmentType = "gcp"
	EnvironmentTypeAzure      EnvironmentType = "azure"
)

func (*EnvironmentType) UnmarshalText

func (p *EnvironmentType) UnmarshalText(text []byte) error

type ImageRef

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

func NewImageRef

func NewImageRef(name, domain, path, tag, imageDigest string) ImageRef

func NewImageRefFrom

func NewImageRefFrom(s string) (ImageRef, error)

func (*ImageRef) Digest

func (i *ImageRef) Digest() digest.Digest

func (*ImageRef) Domain

func (i *ImageRef) Domain() string

func (*ImageRef) Name

func (i *ImageRef) Name() string

func (*ImageRef) Path

func (i *ImageRef) Path() string

func (*ImageRef) String

func (i *ImageRef) String() string

func (*ImageRef) Tag

func (i *ImageRef) Tag() string

func (*ImageRef) UnmarshalText

func (i *ImageRef) UnmarshalText(text []byte) error

type Service

type Service interface {
	fmt.Stringer

	GetID() string
	GetNamespace() string
	GetApplicationName() string
	GetComponentName() string
	GetState() ServiceState
}

type ServiceState

type ServiceState string
const (
	// Service is running and ready.
	ServiceStateReady ServiceState = "Ready"
	// Service is not running or running with errors.
	ServiceStateDegraded ServiceState = "Degraded"
	// Service is running but not ready yet.
	ServiceStateNotReady ServiceState = "NotReady"
	// Service state cannot be determined.
	ServiceStateUnknown ServiceState = "Unknown"
)

func (ServiceState) String

func (s ServiceState) String() string

type Services

type Services []Service

Service is a collection of Service implementation.

func (Services) IDs

func (s Services) IDs() []string

func (Services) States

func (s Services) States() []string

Jump to

Keyboard shortcuts

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