Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type BlobPullPackageJsonOpts
- type BlobPullPackageOpts
- type BlobsApiService
- func (a *BlobsApiService) PullBlob(ctx context.Context, namespace string, package_ string, digest string) ([]byte, *http.Response, error)
- func (a *BlobsApiService) PullBlobJson(ctx context.Context, namespace string, package_ string, digest string, ...) (PullJson, *http.Response, error)
- func (a *BlobsApiService) PullPackage(ctx context.Context, namespace string, package_ string, release string, ...) (*os.File, *http.Response, error)
- func (a *BlobsApiService) PullPackageJson(ctx context.Context, namespace string, package_ string, release string, ...) (PullJson, *http.Response, error)
- type Channel
- type ChannelApiService
- func (a *ChannelApiService) CreateChannel(ctx context.Context, name string, namespace string, package_ string) (Channel, *http.Response, error)
- func (a *ChannelApiService) CreateChannelRelease(ctx context.Context, channel string, namespace string, package_ string, ...) (Channel, *http.Response, error)
- func (a *ChannelApiService) DeleteChannel(ctx context.Context, namespace string, channel string, package_ string) ([]Channel, *http.Response, error)
- func (a *ChannelApiService) DeleteChannelRelease(ctx context.Context, channel string, namespace string, package_ string, ...) ([]Channel, *http.Response, error)
- func (a *ChannelApiService) ListChannels(ctx context.Context, namespace string, package_ string) ([]Channel, *http.Response, error)
- func (a *ChannelApiService) ShowChannel(ctx context.Context, channel string, namespace string, package_ string) ([]Channel, *http.Response, error)
- type Configuration
- type CreatePackageOpts
- type Error
- type GenericOpenAPIError
- type InfoApiService
- type ListPackagesOpts
- type Manifest
- type OciDescriptor
- type Package
- type PackageApiService
- func (a *PackageApiService) CreatePackage(ctx context.Context, body PostPackage, localVarOptionals *CreatePackageOpts) (Package, *http.Response, error)
- func (a *PackageApiService) DeletePackage(ctx context.Context, namespace string, package_ string, release string, ...) (Package, *http.Response, error)
- func (a *PackageApiService) ListPackages(ctx context.Context, localVarOptionals *ListPackagesOpts) ([]PackageDescription, *http.Response, error)
- func (a *PackageApiService) PullPackage(ctx context.Context, namespace string, package_ string, release string, ...) (*os.File, *http.Response, error)
- func (a *PackageApiService) PullPackageJson(ctx context.Context, namespace string, package_ string, release string, ...) (PullJson, *http.Response, error)
- func (a *PackageApiService) ShowPackage(ctx context.Context, namespace string, package_ string, release string, ...) (Package, *http.Response, error)
- func (a *PackageApiService) ShowPackageManifests(ctx context.Context, namespace string, package_ string, release string) ([]Manifest, *http.Response, error)
- func (a *PackageApiService) ShowPackageReleases(ctx context.Context, namespace string, package_ string, ...) ([]Manifest, *http.Response, error)
- type PackageDescription
- type PackagePullPackageJsonOpts
- type PackagePullPackageOpts
- type PostPackage
- type PullBlobJsonOpts
- type PullJson
- type ShowPackageReleasesOpts
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { BlobsApi *BlobsApiService ChannelApi *ChannelApiService InfoApi *InfoApiService PackageApi *PackageApiService // contains filtered or unexported fields }
APIClient manages communication with the APPR API API v0.2.6 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the OpenAPI operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BlobPullPackageJsonOpts ¶
type BlobPullPackageOpts ¶
type BlobsApiService ¶
type BlobsApiService service
func (*BlobsApiService) PullBlob ¶
func (a *BlobsApiService) PullBlob(ctx context.Context, namespace string, package_ string, digest string) ([]byte, *http.Response, error)
BlobsApiService Pull a package blob by digest
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param namespace namespace
- @param package_ package name
- @param digest content digest
@return *os.File
func (*BlobsApiService) PullBlobJson ¶
func (*BlobsApiService) PullPackage ¶
func (*BlobsApiService) PullPackageJson ¶
type Channel ¶
type Channel struct { // Channel name Name string `json:"name,omitempty"` // Current/latest release in the channel. The channel returns this release by default Current string `json:"current,omitempty"` // All availables releases in the channel Releases []string `json:"releases,omitempty"` }
Organize releases into channel, eg: dev/beta/stable
type ChannelApiService ¶
type ChannelApiService service
func (*ChannelApiService) CreateChannel ¶
func (a *ChannelApiService) CreateChannel(ctx context.Context, name string, namespace string, package_ string) (Channel, *http.Response, error)
ChannelApiService Create a new channel
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name Channel name
- @param namespace namespace
- @param package_ package name
@return Channel
func (*ChannelApiService) CreateChannelRelease ¶
func (a *ChannelApiService) CreateChannelRelease(ctx context.Context, channel string, namespace string, package_ string, release string) (Channel, *http.Response, error)
ChannelApiService Add a release to a channel
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param channel channel name
- @param namespace namespace
- @param package_ full package name
- @param release Release name
@return Channel
func (*ChannelApiService) DeleteChannel ¶
func (a *ChannelApiService) DeleteChannel(ctx context.Context, namespace string, channel string, package_ string) ([]Channel, *http.Response, error)
ChannelApiService Delete channel
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param namespace namespace
- @param channel channel name
- @param package_ full package name
@return []Channel
func (*ChannelApiService) DeleteChannelRelease ¶
func (a *ChannelApiService) DeleteChannelRelease(ctx context.Context, channel string, namespace string, package_ string, release string) ([]Channel, *http.Response, error)
ChannelApiService Remove a release from the channel
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param channel channel name
- @param namespace namespace
- @param package_ full package name
- @param release Release name
@return []Channel
func (*ChannelApiService) ListChannels ¶
func (a *ChannelApiService) ListChannels(ctx context.Context, namespace string, package_ string) ([]Channel, *http.Response, error)
ChannelApiService List channels
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param namespace namespace
- @param package_ package name
@return []Channel
func (*ChannelApiService) ShowChannel ¶
func (a *ChannelApiService) ShowChannel(ctx context.Context, channel string, namespace string, package_ string) ([]Channel, *http.Response, error)
ChannelApiService show channel
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param channel channel name
- @param namespace namespace
- @param package_ package name
@return []Channel
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type CreatePackageOpts ¶
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type InfoApiService ¶
type InfoApiService service
func (*InfoApiService) GetVersion ¶
InfoApiService Display api version
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return Version
type ListPackagesOpts ¶
type Manifest ¶
type Manifest struct { // manifest-type MediaType string `json:"mediaType,omitempty"` // creation data CreatedAt string `json:"created_at,omitempty"` // KeyValue object to add complementary and format specific information Metadata map[string]interface{} `json:"metadata,omitempty"` // package name Package string `json:"package,omitempty"` // release name Release string `json:"release,omitempty"` Content OciDescriptor `json:"content,omitempty"` }
type OciDescriptor ¶
type OciDescriptor struct { // content digest Digest string `json:"digest,omitempty"` // blob size Size int64 `json:"size,omitempty"` // content type MediaType string `json:"mediaType,omitempty"` // download mirrors Urls []string `json:"urls,omitempty"` }
OCI descriptor
type Package ¶
type Package struct { // manifest-type MediaType string `json:"mediaType,omitempty"` Channels []string `json:"channels,omitempty"` // Package creation date CreatedAt string `json:"created_at,omitempty"` Content OciDescriptor `json:"content,omitempty"` // Package name Package string `json:"package,omitempty"` // Package release Release string `json:"release,omitempty"` }
Package object
type PackageApiService ¶
type PackageApiService service
func (*PackageApiService) CreatePackage ¶
func (a *PackageApiService) CreatePackage(ctx context.Context, body PostPackage, localVarOptionals *CreatePackageOpts) (Package, *http.Response, error)
func (*PackageApiService) DeletePackage ¶
func (a *PackageApiService) DeletePackage(ctx context.Context, namespace string, package_ string, release string, mediaType string) (Package, *http.Response, error)
PackageApiService Delete a package release
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param namespace namespace
- @param package_ package name
- @param release release name
- @param mediaType content type
@return Package
func (*PackageApiService) ListPackages ¶
func (a *PackageApiService) ListPackages(ctx context.Context, localVarOptionals *ListPackagesOpts) ([]PackageDescription, *http.Response, error)
func (*PackageApiService) PullPackage ¶
func (*PackageApiService) PullPackageJson ¶
func (*PackageApiService) ShowPackage ¶
func (a *PackageApiService) ShowPackage(ctx context.Context, namespace string, package_ string, release string, mediaType string) (Package, *http.Response, error)
PackageApiService Show a package
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param namespace namespace
- @param package_ package name
- @param release release name
- @param mediaType content type
@return Package
func (*PackageApiService) ShowPackageManifests ¶
func (a *PackageApiService) ShowPackageManifests(ctx context.Context, namespace string, package_ string, release string) ([]Manifest, *http.Response, error)
PackageApiService List all manifests for a package
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param namespace namespace
- @param package_ package name
- @param release release name
@return []Manifest
func (*PackageApiService) ShowPackageReleases ¶
func (a *PackageApiService) ShowPackageReleases(ctx context.Context, namespace string, package_ string, localVarOptionals *ShowPackageReleasesOpts) ([]Manifest, *http.Response, error)
type PackageDescription ¶
type PackageDescription struct { // default Default string `json:"default,omitempty"` // visibility Visibility string `json:"visibility,omitempty"` Manifests []string `json:"manifests,omitempty"` Channels []string `json:"channels,omitempty"` // Package creation date CreatedAt string `json:"created_at,omitempty"` // Package creation date UpdatedAt string `json:"updated_at,omitempty"` // Package name Name string `json:"name,omitempty"` // namespace Namespace string `json:"namespace,omitempty"` Releases []string `json:"releases,omitempty"` }
Package Item object
type PackagePullPackageOpts ¶
type PostPackage ¶
type PostPackage struct { // Package blob: a tar.gz in b64-encoded Blob string `json:"blob,omitempty"` // Package name Package string `json:"package,omitempty"` // Package version Release string `json:"release,omitempty"` // mediatype of the blob MediaType string `json:"media_type,omitempty"` }
Package object
type PullBlobJsonOpts ¶
type PullJson ¶
type PullJson struct { // Package blob: a tar.gz in b64-encoded Blob string `json:"blob,omitempty"` // Package name Package string `json:"package,omitempty"` // Package version Release string `json:"release,omitempty"` // suggested filename Filename string `json:"filename,omitempty"` }
Package content