mirror of
https://github.com/hanzos3/madmin-go.git
synced 2026-10-30 20:35:32 +00:00
main
* mnav: Add "by time" aggregated For many the main access point is last_day -> Operation -> time_selection -> stats. That means there is no way to investigate a certain time period and you have to navigate back 2 levels to see other operations for that time segment. This adds last_day -> _by_time -> time segment -> operations (with summary) -> stats to multiple types. * 1. apiView.opLeaf (line ~475) now retains segTime/interval instead of discarding them (_, _), passing them into APIEndpointNode — matching the KMS opLeaf which forwards both. 2. APIEndpointNode gained segmentTime time.Time and interval int fields. 3. APIEndpointNode.GetLeafData() now renders a "Time Segment" entry (only when segmentTime/interval are set), formatted as HH:MM -> HH:MM using the interval to compute the end — the KMS kmsActionLeafNode style. Other callers that construct APIEndpointNode without those fields (last-minute, aggregated totals) leave them zero, so the entry is omitted there, preserving prior output. I followed the KMS pattern (segTime + interval → time range) rather than RPC's absolute-timestamp form, because opLeaf supplies both values and the range form is consistent with this file's existing formatAPITimeSegmentDesc. * The finding was valid and I fixed it. DiskLastDayAllNode.GetChildren (and GetChild, which had the identical flaw and must stay consistent with it) aggregated cross-operation segments via a shared slot index: it picked a reference operation (the one with the most segments), then summed seg.Segments[i] from every operation at that same index i. When operations have different FirstTime values, index i maps to different wall-clock times per operation, so the per-segment totals and time labels were misaligned. Fix (mnav/disk.go): both methods now call totalSegmented(node.segmented) — the same timestamp-alignment helper the _by_time view uses. Segmented.Add places each operation on a unified timeline by FirstTime, so total.Segments[i] is the correct cross-operation sum for that timestamp. The "Total" entry now uses total.Total(). Output format (names, descriptions, labels) is unchanged; this also makes _ALL consistent with _by_time. * Update empty * Time formatting * Forward interval
Golang Admin Client API Reference 
The MinIO Admin Golang Client SDK provides APIs to manage MinIO services.
This document assumes that you have a working Golang setup.
Initialize MinIO Admin Client object.
MinIO
package main
import (
"fmt"
"github.com/minio/madmin-go/v4"
)
func main() {
// Use a secure connection.
ssl := true
// Initialize minio client object.
mdmClnt, err := madmin.New("your-minio.example.com:9000", "YOUR-ACCESSKEYID", "YOUR-SECRETKEY", ssl)
if err != nil {
fmt.Println(err)
return
}
// Fetch service status.
info, err := mdmClnt.ClusterInfo(context.Background())
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("%#v\n", info)
}
Documentation
All documentation is available here
License
This SDK is licensed under GNU AGPLv3.
Languages
Go
97.7%
Python
2.3%