download

package
v2.136.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 12 Imported by: 3

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 is an download service client which can be used to make requests to the server. It extends the generic healthcheck Client structure.

func NewAPIClient

func NewAPIClient(downloadServiceAPIURL, serviceAuthToken string) *Client

NewAPIClient creates a new instance of DownloadServiceAPI Client with a given download service url

func NewWithHealthClient

func NewWithHealthClient(hcCli *healthcheck.Client, serviceAuthToken string) *Client

NewWithHealthClient creates a new instance of DownloadServiceAPI Client, reusing the URL and Clienter from the provided healthcheck client.

func (*Client) Checker

func (c *Client) Checker(ctx context.Context, check *health.CheckState) error

Checker calls download service health endpoint and returns a check object to the caller.

func (*Client) Download

func (c *Client) Download(ctx context.Context, path string) (*Response, error)

Download returns the requested path

func (*Client) HealthClient

func (c *Client) HealthClient() *healthcheck.Client

HealthClient returns the underlying Healthcheck Client for this download service client

func (*Client) URL

func (c *Client) URL() string

URL returns the URL used by this client

type Response

type Response struct {
	Content io.ReadCloser `json:"content"`
}

Jump to

Keyboard shortcuts

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