github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/health/health_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package health 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 health client 19 type API interface { 20 /* 21 GetHealth checks the status of harbor components 22 23 Check the status of Harbor components. This path does not require authentication.*/ 24 GetHealth(ctx context.Context, params *GetHealthParams) (*GetHealthOK, error) 25 } 26 27 // New creates a new health 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 health API 38 */ 39 type Client struct { 40 transport runtime.ClientTransport 41 formats strfmt.Registry 42 authInfo runtime.ClientAuthInfoWriter 43 } 44 45 /* 46 GetHealth checks the status of harbor components 47 48 Check the status of Harbor components. This path does not require authentication. 49 */ 50 func (a *Client) GetHealth(ctx context.Context, params *GetHealthParams) (*GetHealthOK, error) { 51 52 result, err := a.transport.Submit(&runtime.ClientOperation{ 53 ID: "getHealth", 54 Method: "GET", 55 PathPattern: "/health", 56 ProducesMediaTypes: []string{"application/json"}, 57 ConsumesMediaTypes: []string{"application/json"}, 58 Schemes: []string{"http", "https"}, 59 Params: params, 60 Reader: &GetHealthReader{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.(*GetHealthOK), nil 69 70 }