basic

command
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

README

Basic Usage Example

This example demonstrates the basic operations of the Mach storage system.

What it does

  1. Creates a storage instance
  2. Creates a bucket
  3. Stores an object with metadata
  4. Retrieves the object
  5. Lists objects in the bucket
  6. Shows storage statistics
  7. Performs a health check
  8. Cleans up resources

Running the example

cd examples/basic
go run main.go

Expected output

Creating bucket: my-bucket
Putting object: hello.txt
Getting object: hello.txt
Retrieved data: Hello, World!
Content type: text/plain
ETag: 65a8e27d8879283831b664bd8b7f0ad4
Metadata: map[author:example type:greeting]

Listing objects:
- hello.txt (size: 13, modified: 2024-01-01 12:00:00)

Storage statistics:
Buckets: 1
Objects: 1
Total size: 13 bytes

Performing health check:
Health check passed

Cleaning up...
Example completed successfully!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL