package
0.0.0-20250111000811-e389f9ca8354
Repository: https://github.com/taemon1337/ec-manager.git
Documentation: pkg.go.dev
# Functions
AssertContains checks if a string contains a substring.
GetEC2Client retrieves the EC2 client from the context.
GetTestContext returns a context with a mock EC2 client.
GetTestContextWithClient returns a context with the given mock EC2 client.
InitTestLogger initializes a logger for testing with debug level.
MockImage creates a mock AMI with common fields.
MockInstance creates a mock EC2 instance with common fields.
RunCommandTest runs a command test with the given test cases.
SetupDefaultMocks configures common mock responses for testing.
SetupImageMock configures common image-related mock responses.
SetupInstanceMock configures common instance-related mock responses.
SetupMockEC2Client sets up a mock EC2 client for testing.
SetupTestCommand sets up a test command with the given arguments.
SetupTestLogger sets up a test logger that writes to a buffer with info level.
# Constants
EC2ClientKey is the context key for the EC2 client.
# Structs
CommandTestCase represents a test case for a cobra command.
# Type aliases
ContextKey is a custom type for context keys to avoid collisions.