-
Release v1.0.0 Stable
released this
2026-05-19 21:45:04 -06:00 | 0 commits to main since this releasev1.0.0
code.nochebuena.dev/go/minioOverview
miniov1.0.0 commits the MinIO client lifecycle API as stable. The module manages the
lifecycle of aminio-goSDK client: constructs it from config, verifies that the configured
bucket exists at startup (creating it if absent), exposes aClientinterface with the most
common object operations, maps minio-go errors to portablexerrorscodes, and provides a
health check viaBucketExists.Full API (stable)
Config— embeddable struct with env tags:Field Env var Required Default Notes EndpointMINIO_ENDPOINTYes — Host and port, e.g. minio:9000AccessKeyMINIO_ACCESS_KEYYes — SecretKeyMINIO_SECRET_KEYYes — BucketMINIO_BUCKETYes — Created at startup if it does not exist UseSSLMINIO_USE_SSLNo falseRegionMINIO_REGIONNo us-east-1Bypasses per-request region detection Transport(env:"-") No nilFor test injection only Client— inject into repositories for direct object operations:type Client interface { PutObject(ctx, bucket, key string, reader io.Reader, size int64, opts miniogo.PutObjectOptions) (miniogo.UploadInfo, error) GetObject(ctx, bucket, key string, opts miniogo.GetObjectOptions) (*miniogo.Object, error) RemoveObject(ctx, bucket, key string, opts miniogo.RemoveObjectOptions) error PresignedGetObject(ctx, bucket, key string, expires time.Duration, reqParams url.Values) (*url.URL, error) HandleError(err error) error }All methods return errors already mapped to
xerrorstyped values. When usingNative()
directly, callHandleErrorbefore returning errors to callers.Component— embedslauncher.Component,health.Checkable,Client, andNative();
register withlc.Append.New(logger logz.Logger, cfg Config) Component— constructor; SDK client created inOnInit.HandleError(err error) error— package-level function andClientmethod; maps minio-go
ErrorResponsecodes to xerrors:minio-go code xerrors code NoSuchBucketErrNotFoundNoSuchKeyErrNotFoundAccessDenied,InvalidAccessKeyIdErrPermissionDeniedBucketAlreadyExists,BucketAlreadyOwnedByYouErrAlreadyExistsanything else ErrInternalHealthCheck(ctx) error— callsBucketExists; priorityhealth.LevelCritical.Lifecycle
Hook Behaviour OnInitConstructs the minio-go SDK client; no network call OnStartChecks whether the configured bucket exists; creates it if not OnStopSets internal client to nil; minio-go is statelessUsage
go get code.nochebuena.dev/go/minio@v1.0.0Downloads