github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/statistic/statistic_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package statistic 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "context" 10 11 "github.com/go-openapi/runtime" 12 13 strfmt "github.com/go-openapi/strfmt" 14 ) 15 16 //go:generate mockery -name API -inpkg 17 18 // API is the interface of the statistic client 19 type API interface { 20 /* 21 GetStatistic gets the statistic information about the projects and repositories 22 23 Get the statistic information about the projects and repositories*/ 24 GetStatistic(ctx context.Context, params *GetStatisticParams) (*GetStatisticOK, error) 25 } 26 27 // New creates a new statistic API client. 28 func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client { 29 return &Client{ 30 transport: transport, 31 formats: formats, 32 authInfo: authInfo, 33 } 34 } 35 36 /* 37 Client for statistic API 38 */ 39 type Client struct { 40 transport runtime.ClientTransport 41 formats strfmt.Registry 42 authInfo runtime.ClientAuthInfoWriter 43 } 44 45 /* 46 GetStatistic gets the statistic information about the projects and repositories 47 48 Get the statistic information about the projects and repositories 49 */ 50 func (a *Client) GetStatistic(ctx context.Context, params *GetStatisticParams) (*GetStatisticOK, error) { 51 52 result, err := a.transport.Submit(&runtime.ClientOperation{ 53 ID: "getStatistic", 54 Method: "GET", 55 PathPattern: "/statistics", 56 ProducesMediaTypes: []string{"application/json"}, 57 ConsumesMediaTypes: []string{"application/json"}, 58 Schemes: []string{"http", "https"}, 59 Params: params, 60 Reader: &GetStatisticReader{formats: a.formats}, 61 AuthInfo: a.authInfo, 62 Context: ctx, 63 Client: params.HTTPClient, 64 }) 65 if err != nil { 66 return nil, err 67 } 68 return result.(*GetStatisticOK), nil 69 70 }