func main() { // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY are // dummy values, please replace them with original values. // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. // This boolean value is the last argument for New(). // New returns an Minio Admin client object. madmClnt, err := madmin.New("your-minio.example.com:9000", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) if err != nil { log.Fatalln(err) } err = madmClnt.ServiceRestart() if err != nil { log.Fatalln(err) } log.Println("Success") }
func TestMinioAdminClient(t *testing.T) { _, err := madmin.New("localhost:9000", "food", "food123", true) if err != nil { t.Fatal(err) } }