db_test

package
v0.0.0-...-c3677c5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertAssignment

func InsertAssignment(db *sql.DB, assignmentID string) error

func InsertAssignments

func InsertAssignments(db *sql.DB, n int) error

func InsertBranchEni

func InsertBranchEni(db *sql.DB, branchEni string, securitGroups []string, mac string) error

func InsertBranchEniAttachment

func InsertBranchEniAttachment(db *sql.DB, branchEni, state string) error

func InsertBranchEniAttachments

func InsertBranchEniAttachments(db *sql.DB, start, end int, state string) error

Insert rows into branch_eni_attachments table for branch ENIs in range ["eni-<start>", "eni-<end>")

func InsertBranchEnis

func InsertBranchEnis(db *sql.DB, n int) error

Insert N branc ENIs with id being eni-0, eni-1, ...

func InsertSecurityGroup

func InsertSecurityGroup(db *sql.DB, groupID string) error

func InsertSubnet

func InsertSubnet(db *sql.DB, subnetID string) error

func InsertSubnets

func InsertSubnets(db *sql.DB, n int) error

Insert N subnets with id being subnet-0, subnet-1, ...

func RandomPort

func RandomPort() (string, error)

Types

type PostgresContainer

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

func StartPostgresContainer

func StartPostgresContainer(ctx context.Context, name string) (*PostgresContainer, error)

Start a postgres container locally for testing.

func (*PostgresContainer) Connect

func (c *PostgresContainer) Connect(ctx context.Context) (*sql.DB, error)

Connect to the test DB

func (*PostgresContainer) DBURL

func (c *PostgresContainer) DBURL() string

func (*PostgresContainer) Shutdown

func (c *PostgresContainer) Shutdown(ctx context.Context) error

Stop and remove the container

Jump to

Keyboard shortcuts

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