version

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for version API.

func (*Client) GetVersion

func (a *Client) GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error)

GetVersion gets the build this server is running.

Reports the scorecard-infra release and commit this server was built from, and the workflow parser that verifies uploads. Cached by the CDN for the TTL in the response's Surrogate-Control header..

This method does not support injected context. However, timeout and opentracing contexts are honored whenever enabled.

If you need to pass a specific context, use Client.GetVersionContext instead.

func (*Client) GetVersionContext

func (a *Client) GetVersionContext(ctx context.Context, params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error)

GetVersionContext gets the build this server is running.

Reports the scorecard-infra release and commit this server was built from, and the workflow parser that verifies uploads. Cached by the CDN for the TTL in the response's Surrogate-Control header..

Do not use the deprecated [GetVersionParams.Context] with this method: it would be ignored.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ContextualTransport)

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption may be used to customize the behavior of Client methods.

type ClientService

type ClientService interface {

	// GetVersion get the build this server is running.
	GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error)

	// GetVersionContext get the build this server is running.
	GetVersionContext(ctx context.Context, params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error)

	SetTransport(transport runtime.ContextualTransport)
}

ClientService is the interface for Client methods.

func New

New creates a new version API client.

func NewClientWithBasicAuth

func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService

New creates a new version API client with basic auth credentials.

It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - user: user for basic authentication header. - password: password for basic authentication header.

func NewClientWithBearerToken

func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService

New creates a new version API client with a bearer token for authentication.

It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - bearerToken: bearer token for Bearer authentication header.

type GetVersionOK

type GetVersionOK struct {

	// TTL for browser caching. Example: max-age=3600
	CacheControl string

	// TTL for Fastly CDN caching. Example: max-age=3600
	SurrogateControl string

	// Surrogate key for Fastly CDN purging.
	SurrogateKey string

	Payload *models.VersionInfo
}

GetVersionOK describes a response with status code 200, with default header values.

The server's build information

func NewGetVersionOK

func NewGetVersionOK() *GetVersionOK

NewGetVersionOK creates a GetVersionOK with default headers values

func (*GetVersionOK) Code

func (o *GetVersionOK) Code() int

Code gets the status code for the get version o k response

func (*GetVersionOK) Error

func (o *GetVersionOK) Error() string

func (*GetVersionOK) GetPayload

func (o *GetVersionOK) GetPayload() *models.VersionInfo

func (*GetVersionOK) IsClientError

func (o *GetVersionOK) IsClientError() bool

IsClientError returns true when this get version o k response has a 4xx status code

func (*GetVersionOK) IsCode

func (o *GetVersionOK) IsCode(code int) bool

IsCode returns true when this get version o k response a status code equal to that given

func (*GetVersionOK) IsRedirect

func (o *GetVersionOK) IsRedirect() bool

IsRedirect returns true when this get version o k response has a 3xx status code

func (*GetVersionOK) IsServerError

func (o *GetVersionOK) IsServerError() bool

IsServerError returns true when this get version o k response has a 5xx status code

func (*GetVersionOK) IsSuccess

func (o *GetVersionOK) IsSuccess() bool

IsSuccess returns true when this get version o k response has a 2xx status code

func (*GetVersionOK) String

func (o *GetVersionOK) String() string

type GetVersionParams

type GetVersionParams struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

GetVersionParams contains all the parameters to send to the API endpoint

for the get version operation.

Typically these are written to a http.Request.

func NewGetVersionParams

func NewGetVersionParams() *GetVersionParams

NewGetVersionParams creates a new GetVersionParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewGetVersionParamsWithContext deprecated

func NewGetVersionParamsWithContext(ctx context.Context) *GetVersionParams

NewGetVersionParamsWithContext creates a new GetVersionParams object with the ability to set a context for a request.

Deprecated: use the operation call with context to pass the context instead of GetVersionParams.

func NewGetVersionParamsWithHTTPClient

func NewGetVersionParamsWithHTTPClient(client *http.Client) *GetVersionParams

NewGetVersionParamsWithHTTPClient creates a new GetVersionParams object with the ability to set a custom HTTPClient for a request.

func NewGetVersionParamsWithTimeout

func NewGetVersionParamsWithTimeout(timeout time.Duration) *GetVersionParams

NewGetVersionParamsWithTimeout creates a new GetVersionParams object with the ability to set a timeout on a request.

func (*GetVersionParams) SetContext deprecated

func (o *GetVersionParams) SetContext(ctx context.Context)

SetContext adds the context to the get version params.

Deprecated: use the operation call with context to pass the context instead of GetVersionParams.

func (*GetVersionParams) SetDefaults

func (o *GetVersionParams) SetDefaults()

SetDefaults hydrates default values in the get version params (not the query body).

All values with no default are reset to their zero value.

func (*GetVersionParams) SetHTTPClient

func (o *GetVersionParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the get version params.

func (*GetVersionParams) SetTimeout

func (o *GetVersionParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the get version params.

func (*GetVersionParams) WithContext deprecated

func (o *GetVersionParams) WithContext(ctx context.Context) *GetVersionParams

WithContext adds the context to the get version params.

Deprecated: use the operation call with context to pass the context instead of GetVersionParams.

func (*GetVersionParams) WithDefaults

func (o *GetVersionParams) WithDefaults() *GetVersionParams

WithDefaults hydrates default values in the get version params (not the query body).

All values with no default are reset to their zero value.

func (*GetVersionParams) WithHTTPClient

func (o *GetVersionParams) WithHTTPClient(client *http.Client) *GetVersionParams

WithHTTPClient adds the HTTPClient to the get version params.

func (*GetVersionParams) WithTimeout

func (o *GetVersionParams) WithTimeout(timeout time.Duration) *GetVersionParams

WithTimeout adds the timeout to the get version params.

func (*GetVersionParams) WriteToRequest

func (o *GetVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a runtime.ClientRequest.

type GetVersionReader

type GetVersionReader struct {
	// contains filtered or unexported fields
}

GetVersionReader is a Reader for the GetVersion structure.

func (*GetVersionReader) ReadResponse

func (o *GetVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL