Documentation
¶
Overview ¶
Package images provides periodic image resolution and caching across infrastructure providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSResolver ¶
type AWSResolver struct {
// contains filtered or unexported fields
}
AWSResolver implements the Resolver interface for AWS EC2
func NewAWSResolver ¶
func NewAWSResolver(providerCfg infra.ProviderConfig) (*AWSResolver, error)
NewAWSResolver creates a new AWS image resolver
func NewAWSResolverWithClient ¶
func NewAWSResolverWithClient(client EC2API, region string) *AWSResolver
NewAWSResolverWithClient creates a new AWS image resolver with a custom EC2 client (for testing)
func (*AWSResolver) Resolve ¶
func (r *AWSResolver) Resolve(ctx context.Context, configs map[string]config.ImageConfig) (map[string]string, error)
Resolve looks up all configured images and returns a map of name -> image ID
func (*AWSResolver) ResolveOne ¶
func (r *AWSResolver) ResolveOne(ctx context.Context, name string, cfg config.ImageConfig) (string, error)
ResolveOne looks up a single image configuration
type EC2API ¶
type EC2API interface {
DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)
}
EC2API defines the interface for EC2 operations needed by AWSResolver
type Resolver ¶
type Resolver interface {
// Resolve looks up all configured images and returns a map of name -> image ID
Resolve(ctx context.Context, configs map[string]config.ImageConfig) (map[string]string, error)
// ResolveOne looks up a single image configuration
ResolveOne(ctx context.Context, name string, cfg config.ImageConfig) (string, error)
}
Resolver interface supports multiple cloud providers Initial implementation: AWS only In future, other providers requiring this mechanism, such as Oracle Cloud, could be added
func NewResolver ¶
func NewResolver(provider string, providerCfg infra.ProviderConfig) (Resolver, error)
NewResolver creates a provider-specific resolver
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages periodic image resolution and caching
func NewService ¶
func NewService(opts ServiceOptions) (*Service, error)
NewService creates a new image resolution service
func (*Service) Get ¶
Get returns the resolved image ID for a given image name Returns empty string if not resolved
type ServiceOptions ¶
type ServiceOptions struct {
ProviderConfig infra.ProviderConfig
DB *localdb.DB
Configs map[string]config.ImageConfig
Interval time.Duration
Logger *slog.Logger
}
ServiceOptions contains options for creating an image service