cloudapitest

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cloudapitest provides a stand-in for Miren Cloud's HTTP API, so tests that need cloud to answer something can have it answer without a cloud.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*httptest.Server
	// contains filtered or unexported fields
}

Server is a fake Miren Cloud serving the endpoints cloudapi.Client calls. It records which clusters were asked about, which is how a test checks that a caller asked about the clusters it should have and left the rest alone.

func NewServer

func NewServer(clusters []cloudapi.Cluster, online map[string]bool, status int) *Server

NewServer returns a fake cloud holding the given clusters, reporting online for the cluster ids set to true in online. Close it when the test is done.

Pass a non-OK status to make every request fail, which is how a test tells "cloud said no" apart from "cloud would not answer".

func (*Server) Asked

func (s *Server) Asked() []string

Asked returns the cluster ids whose presence was checked, in request order.

Jump to

Keyboard shortcuts

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