client

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package client provides a versions API specific implementation of the general API client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, region, bucket, distributionID string, dryRun bool,
	log *logger.Logger,
) (*VersionsClient, CloseFunc, error)

NewClient creates a new client for the versions API.

func NewReadOnlyClient

func NewReadOnlyClient(ctx context.Context, region, bucket, distributionID string,
	log *logger.Logger,
) (*VersionsClient, CloseFunc, error)

NewReadOnlyClient creates a new read-only client. This client can be used to fetch objects but cannot write updates.

Types

type CloseFunc

type CloseFunc func(ctx context.Context) error

CloseFunc is a function that closes the client.

type VersionsClient

type VersionsClient struct {
	*apiclient.Client
	// contains filtered or unexported fields
}

VersionsClient is a client for the versions API.

func (*VersionsClient) Close

func (c *VersionsClient) Close(ctx context.Context) error

Close closes the client.

func (*VersionsClient) DeleteRef

func (c *VersionsClient) DeleteRef(ctx context.Context, ref string) error

DeleteRef deletes the given ref from the versions API.

func (*VersionsClient) DeleteVersion

func (c *VersionsClient) DeleteVersion(ctx context.Context, ver versionsapi.Version) error

DeleteVersion deletes the given version from the versions API. The version will be removed from version lists and latest versions, and the versioned objects are deleted. Notice that the versions API can get into an inconsistent state if the version is the latest version but there is no older version of the same minor version available. Manual update of latest versions is required in this case.

func (*VersionsClient) FetchCLIInfo

func (c *VersionsClient) FetchCLIInfo(ctx context.Context, cliInfo versionsapi.CLIInfo) (versionsapi.CLIInfo, error)

FetchCLIInfo fetches the given CLI info from the versions API.

func (*VersionsClient) FetchImageInfo

func (c *VersionsClient) FetchImageInfo(ctx context.Context, imageInfo versionsapi.ImageInfo) (versionsapi.ImageInfo, error)

FetchImageInfo fetches the given image info from the versions API.

func (*VersionsClient) FetchVersionLatest

func (c *VersionsClient) FetchVersionLatest(ctx context.Context, latest versionsapi.Latest) (versionsapi.Latest, error)

FetchVersionLatest fetches the latest version from the versions API.

func (*VersionsClient) FetchVersionList

func (c *VersionsClient) FetchVersionList(ctx context.Context, list versionsapi.List) (versionsapi.List, error)

FetchVersionList fetches the given version list from the versions API.

func (*VersionsClient) UpdateCLIInfo

func (c *VersionsClient) UpdateCLIInfo(ctx context.Context, cliInfo versionsapi.CLIInfo) error

UpdateCLIInfo updates the given CLI info in the versions API.

func (*VersionsClient) UpdateImageInfo

func (c *VersionsClient) UpdateImageInfo(ctx context.Context, imageInfo versionsapi.ImageInfo) error

UpdateImageInfo updates the given image info in the versions API.

func (*VersionsClient) UpdateVersionLatest

func (c *VersionsClient) UpdateVersionLatest(ctx context.Context, latest versionsapi.Latest) error

UpdateVersionLatest updates the latest version in the versions API.

func (*VersionsClient) UpdateVersionList

func (c *VersionsClient) UpdateVersionList(ctx context.Context, list versionsapi.List) error

UpdateVersionList updates the given version list in the versions API.

Jump to

Keyboard shortcuts

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