oci

package
v0.0.0-...-2c737b7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "dl"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "0.0.1"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "oci"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [3]string{"list-files", "download-file", "download-file-sha256"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeInternalError

func MakeInternalError(err error) *goa.ServiceError

MakeInternalError builds a goa.ServiceError from an error.

func MakeInvalidFilePath

func MakeInvalidFilePath(err error) *goa.ServiceError

MakeInvalidFilePath builds a goa.ServiceError from an error.

func NewDownloadFileEndpoint

func NewDownloadFileEndpoint(s Service) goa.Endpoint

NewDownloadFileEndpoint returns an endpoint function that calls the method "download-file" of service "oci".

func NewDownloadFileSha256Endpoint

func NewDownloadFileSha256Endpoint(s Service) goa.Endpoint

NewDownloadFileSha256Endpoint returns an endpoint function that calls the method "download-file-sha256" of service "oci".

func NewListFilesEndpoint

func NewListFilesEndpoint(s Service) goa.Endpoint

NewListFilesEndpoint returns an endpoint function that calls the method "list-files" of service "oci".

Types

type Client

type Client struct {
	ListFilesEndpoint          goa.Endpoint
	DownloadFileEndpoint       goa.Endpoint
	DownloadFileSha256Endpoint goa.Endpoint
}

Client is the "oci" service client.

func NewClient

func NewClient(listFiles, downloadFile, downloadFileSha256 goa.Endpoint) *Client

NewClient initializes a "oci" service client given the endpoints.

func (*Client) DownloadFile

func (c *Client) DownloadFile(ctx context.Context, p *DownloadFilePayload) (res *DownloadFileResult, resp io.ReadCloser, err error)

DownloadFile calls the "download-file" endpoint of the "oci" service. DownloadFile may return the following errors:

  • "invalid_file_path" (type *goa.ServiceError): Could not locate file for download
  • "internal_error" (type *goa.ServiceError): Fault while processing download.
  • error: internal error

func (*Client) DownloadFileSha256

func (c *Client) DownloadFileSha256(ctx context.Context, p *DownloadFileSha256Payload) (res *DownloadFileSha256Result, resp io.ReadCloser, err error)

DownloadFileSha256 calls the "download-file-sha256" endpoint of the "oci" service. DownloadFileSha256 may return the following errors:

  • "invalid_file_path" (type *goa.ServiceError): Could not locate file for download
  • "internal_error" (type *goa.ServiceError): Fault while processing download.
  • error: internal error

func (*Client) ListFiles

func (c *Client) ListFiles(ctx context.Context, p *ListFilesPayload) (res []string, err error)

ListFiles calls the "list-files" endpoint of the "oci" service.

type DownloadFilePayload

type DownloadFilePayload struct {
	// OCI artifact repository
	Repository string
	// OCI artifact tag
	Tag string
	// file name in OCI artifact
	File *string
	// file name regexp pattern
	FileRegex *string
}

DownloadFilePayload is the payload type of the oci service download-file method.

type DownloadFileResponseData

type DownloadFileResponseData struct {
	// Result is the method result.
	Result *DownloadFileResult
	// Body streams the HTTP response body.
	Body io.ReadCloser
}

DownloadFileResponseData holds both the result and the HTTP response body reader of the "download-file" method.

type DownloadFileResult

type DownloadFileResult struct {
	// Length is the downloaded content length in bytes.
	Length int64
	// Content-Disposition header for downloading
	ContentDisposition string
}

DownloadFileResult is the result type of the oci service download-file method.

type DownloadFileSha256Payload

type DownloadFileSha256Payload struct {
	// OCI artifact repository
	Repository string
	// OCI artifact tag
	Tag string
	// file name in OCI artifact
	File string
}

DownloadFileSha256Payload is the payload type of the oci service download-file-sha256 method.

type DownloadFileSha256ResponseData

type DownloadFileSha256ResponseData struct {
	// Result is the method result.
	Result *DownloadFileSha256Result
	// Body streams the HTTP response body.
	Body io.ReadCloser
}

DownloadFileSha256ResponseData holds both the result and the HTTP response body reader of the "download-file-sha256" method.

type DownloadFileSha256Result

type DownloadFileSha256Result struct {
	// Length is the downloaded content length in bytes.
	Length int64
	// Content-Disposition header for downloading
	ContentDisposition string
}

DownloadFileSha256Result is the result type of the oci service download-file-sha256 method.

type Endpoints

type Endpoints struct {
	ListFiles          goa.Endpoint
	DownloadFile       goa.Endpoint
	DownloadFileSha256 goa.Endpoint
}

Endpoints wraps the "oci" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "oci" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "oci" service endpoints.

type ListFilesPayload

type ListFilesPayload struct {
	// OCI artifact repository
	Repository string
	// OCI artifact tag
	Tag string
}

ListFilesPayload is the payload type of the oci service list-files method.

type Service

type Service interface {
	// ListFiles implements list-files.
	ListFiles(context.Context, *ListFilesPayload) (res []string, err error)
	// DownloadFile implements download-file.
	DownloadFile(context.Context, *DownloadFilePayload) (res *DownloadFileResult, body io.ReadCloser, err error)
	// DownloadFileSha256 implements download-file-sha256.
	DownloadFileSha256(context.Context, *DownloadFileSha256Payload) (res *DownloadFileSha256Result, body io.ReadCloser, err error)
}

OCI artifacts download service

Jump to

Keyboard shortcuts

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