client

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.16.0

type Cache interface {
	// Get returns cache for a specified catalog name and version (resolvedRef).
	//
	// Method behaviour is as follows:
	//   - If cache exists, it returns a non-nil fs.FS and nil error
	//   - If cache doesn't exist, it returns nil fs.FS and nil error
	//   - If there was an error during cache population,
	//     it returns nil fs.FS and the error from the cache population.
	//     In other words - cache population errors are also cached.
	Get(catalogName, resolvedRef string) (fs.FS, error)

	// Put writes content from source or from errToCache in the cache backend
	// for a specified catalog name and version (resolvedRef).
	//
	// Method behaviour is as follows:
	//   - If successfully populated cache for catalogName and resolvedRef exists,
	//     errToCache is ignored and existing cache returned with nil error
	//   - If existing cache for catalogName and resolvedRef exists but
	//     is populated with an error, update the cache with either
	//     new content from source or errToCache.
	//   - If cache doesn't exist, populate it with either new content
	//     from source or errToCache.
	Put(catalogName, resolvedRef string, source io.Reader, errToCache error) (fs.FS, error)
}

type Client

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

Client is reading catalog metadata

func New added in v0.6.0

func New(cache Cache, httpClient func() (*http.Client, error)) *Client

func (*Client) GetPackage added in v0.13.0

func (c *Client) GetPackage(ctx context.Context, catalog *catalogd.ClusterCatalog, pkgName string) (*declcfg.DeclarativeConfig, error)

func (*Client) PopulateCache added in v0.16.0

func (c *Client) PopulateCache(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error)

Jump to

Keyboard shortcuts

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