Harbor API Client for Golang
This project was generated by go-swagger using harbor swagger
package main
import (
"encoding/json"
"fmt"
httpTransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
apiClient "github.com/ymping/goharbor/client"
"github.com/ymping/goharbor/client/statistic"
)
func main() {
transport := apiClient.DefaultTransportConfig()
transport.WithHost("hub.example.com")
transport.WithSchemes([]string{"https"})
client := apiClient.NewHTTPClientWithConfig(strfmt.Default, transport)
basicAuth := httpTransport.BasicAuth("admin", "XXXXXX")
param := statistic.NewGetStatisticParams()
ok, err := client.Statistic.GetStatistic(param, basicAuth)
if err != nil {
panic(err)
}
s, err := json.Marshal(ok.Payload)
if err != nil {
panic(err)
}
fmt.Println(string(s))
}