httpsfixture

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package httpsfixture is the downloads a test serves through test/e2e/httpsserver: the runner harness from a container, and the https-sources acceptance phase on kind. One definition, so the documents the harness captures answer the files the phase reads.

Every archive is built with fixed times, owners and modes, so the same definition gives the same bytes and the same download digest on every run.

Index

Constants

View Source
const (
	// SchemaFile is a schema served as one file.
	SchemaFile = "schema.sql"
	// MigrationArchive is a gzip-compressed tar holding the migration
	// directory under MigrationPath.
	MigrationArchive = "migrations.tar.gz"
	// SchemaArchive is a zip holding the schema at SchemaInArchive, beside a
	// file no source selects.
	SchemaArchive = "schema.zip"
	// SchemaArchiveRepublished holds the same selected file as SchemaArchive
	// in other bytes: the file beside it says something else.
	SchemaArchiveRepublished = "schema-republished.zip"
	// DotDotArchive holds an entry that names a path outside the archive.
	DotDotArchive = "dotdot.tar.gz"
	// SymlinkArchive holds a symbolic link inside the selected directory.
	SymlinkArchive = "symlink.tar.gz"

	MigrationPath   = "orders-1.0/db/migrations"
	SchemaInArchive = "app-1.0/db/schema.sql"
)

The names the server serves the downloads by, and what each one selects.

View Source
const Schema = "CREATE TABLE e2e_https_items (\n  id bigint NOT NULL PRIMARY KEY,\n  name text NOT NULL\n);\n"

Schema is the desired schema every schema download carries.

Variables

View Source
var MigrationFiles = map[string]string{
	"0000000001_create_https_parts.up.sql":   "CREATE TABLE e2e_https_parts (\n    id INTEGER PRIMARY KEY,\n    name TEXT NOT NULL\n);\n",
	"0000000001_create_https_parts.down.sql": "DROP TABLE e2e_https_parts;\n",
	"0000000002_add_https_sku.up.sql":        "ALTER TABLE e2e_https_parts ADD COLUMN sku TEXT;\n",
	"0000000002_add_https_sku.down.sql":      "ALTER TABLE e2e_https_parts DROP COLUMN sku;\n",
}

MigrationFiles is the migration directory the archive carries.

Functions

func Digest

func Digest(data []byte) string

Digest is the download digest of bytes: what a spec pins.

func Files

func Files() (map[string][]byte, error)

Files is every download by the name the server serves it under.

func MigrationContent

func MigrationContent() (string, error)

MigrationContent is the content digest of the migration directory.

func SchemaContent

func SchemaContent(name string) (string, error)

SchemaContent is the content digest of the schema as the operator binds it: one file, by its own name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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