Documentation
¶
Overview ¶
Package blob is a minimal S3/MinIO object client for the few places Miabi must touch an object store directly from Go: a bundle's control objects and bucket listings, and `miabi restore`, which reads a sealed envelope on a bare host before any platform exists.
Index ¶
- Variables
- type Config
- type Object
- type Probe
- type Store
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Exists(ctx context.Context, key string) (bool, error)
- func (s *Store) Get(ctx context.Context, key string) (io.ReadCloser, int64, error)
- func (s *Store) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (s *Store) List(ctx context.Context, prefix string) ([]Object, error)
- func (s *Store) Put(ctx context.Context, key string, body []byte) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("object not found")
ErrNotFound is returned when an object (or the bucket) does not exist.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Endpoint string // empty for AWS S3; host or URL for MinIO and friends
Bucket string
Region string
AccessKey string
SecretKey string
UseSSL bool
ForcePathStyle bool
}
Config describes an S3-compatible target. It mirrors the fields of the backup S3 settings so callers can hand the same values to either path.
type Probe ¶
type Probe struct {
// Key is the object the probe used, for the message shown to the operator.
Key string
// Wrote, ReadBack and Removed record how far it got.
Wrote bool
ReadBack bool
Removed bool
}
Probe verifies a target end to end by using it: writes a small object, reads it back, compares the bytes, removes it. Deliberately not a HeadBucket — a bucket that exists says nothing about whether these credentials may write to it under the attached policy.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a bucket-scoped object client.
func New ¶
New builds a client for cfg. It does not contact the network; the first Get/Put/List reports connectivity or credential problems.
func (*Store) Delete ¶
Delete removes an object. Deleting an absent object is not an error, so retention pruning is idempotent.
func (*Store) GetBytes ¶
GetBytes reads a whole object. Intended for small control objects (the identity envelope, manifests) — not for artifacts.