Skip to content

ymping/goharbor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goharbor

Harbor API Client for Golang

This project was generated by go-swagger using harbor swagger

usage example

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))
}

About

Harbor API Client for Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages