Add Client interface with PutObject, GetObject, RemoveObject, PresignedGetObject, and HandleError; Component now embeds Client with Native() as escape hatch for operations not covered by the interface. Add xerrors dependency: HandleError maps minio-go error codes to portable typed codes (NoSuchKey → ErrNotFound, AccessDenied → ErrPermissionDenied, BucketAlreadyExists → ErrAlreadyExists, etc.). OnStop sets c.mc = nil for lifecycle consistency. doc.go updated with launcher wiring, upload, presigned URL, GetObject, and HandleError usage examples. API committed as stable. What's included: - Config with Endpoint, AccessKey, SecretKey, UseSSL, Bucket, Region (env-driven, embeddable) - Transport field in Config for test injection (env:"-", nil uses minio-go default) - Client interface: PutObject, GetObject, RemoveObject, PresignedGetObject, HandleError - Component interface: launcher.Component + health.Checkable + Client + Native() - New(logger, cfg) constructor for lifecycle registration via lc.Append - Automatic bucket creation on OnStart if bucket does not exist - Health check via BucketExists at LevelCritical priority - HandleError: maps minio-go ErrorResponse codes to xerrors typed errors - 21 unit tests using mock HTTP transport; no live server required
649 B
649 B
Changelog
All notable changes to this module will be documented in this file.
[v0.9.0] — 2026-05-20
Added
Config— env-tagged, embeddable struct:Endpoint,AccessKey,SecretKey,UseSSL,Bucket,Region,TransportProviderinterface —Native() *minio.ClientComponentinterface —launcher.Component + health.Checkable + ProviderNew(logger logz.Logger, cfg Config) Component— constructor- Automatic bucket creation on
OnStartif the configured bucket does not exist - Health check via
BucketExistsathealth.LevelCriticalpriority OnStopis a no-op — minio-go client is stateless