grpc

package
v0.8.93 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOpts

type ClientOpts func(u *casClient)

func WithLogger

func WithLogger(l zerolog.Logger) ClientOpts

func WithProgressRender

func WithProgressRender(b bool) ClientOpts

type DownloaderClient

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

func NewDownloader

func NewDownloader(conn *grpc.ClientConn, opts ...ClientOpts) *DownloaderClient

func (*DownloaderClient) Describe

func (c *DownloaderClient) Describe(ctx context.Context, digest string) (*materials.ResourceInfo, error)

Describe returns the metadata of a resource by its digest We use this to get the filename and the total size of the artifacct

func (*DownloaderClient) Download

func (c *DownloaderClient) Download(ctx context.Context, w io.Writer, digest string, totalBytes int64) error

Download downloads a file from the CAS and writes it to the provided writer It also receives a totalBytes parameter to render the progress bar

type UploaderClient

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

func NewUploader

func NewUploader(conn *grpc.ClientConn, opts ...ClientOpts) *UploaderClient

func (*UploaderClient) Upload

func (c *UploaderClient) Upload(ctx context.Context, filepath string) (*materials.UpDownStatus, error)

Uploads a given file to a CAS server

Jump to

Keyboard shortcuts

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