keppelv1

package
v0.0.0-...-11bd816 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const SubleaseHeader = "X-Keppel-Sublease-Token"

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API contains state variables used by the Keppel V1 API implementation.

func NewAPI

NewAPI constructs a new API instance.

func (*API) AddTo

func (a *API) AddTo(r *mux.Router)

AddTo implements the api.API interface.

type AuditQuotas

type AuditQuotas struct {
	QuotasBefore models.Quotas
	QuotasAfter  models.Quotas
}

AuditQuotas is an audittools.TargetRenderer.

func (AuditQuotas) Render

func (a AuditQuotas) Render() cadf.Resource

Render implements the audittools.TargetRenderer interface.

type AuditSecurityScanPolicy

type AuditSecurityScanPolicy struct {
	Account models.Account
	Policy  keppel.SecurityScanPolicy
}

AuditSecurityScanPolicy is an audittools.TargetRenderer.

func (AuditSecurityScanPolicy) Render

Render implements the audittools.TargetRenderer interface.

type Manifest

type Manifest struct {
	Digest                        digest.Digest              `json:"digest"`
	MediaType                     string                     `json:"media_type"`
	SizeBytes                     uint64                     `json:"size_bytes"`
	PushedAt                      int64                      `json:"pushed_at"`
	LastPulledAt                  *int64                     `json:"last_pulled_at"`
	Tags                          []Tag                      `json:"tags,omitempty"`
	LabelsJSON                    json.RawMessage            `json:"labels,omitempty"`
	GCStatusJSON                  json.RawMessage            `json:"gc_status,omitempty"`
	VulnerabilityStatus           models.VulnerabilityStatus `json:"vulnerability_status"`
	VulnerabilityScanErrorMessage string                     `json:"vulnerability_scan_error,omitempty"`
	MinLayerCreatedAt             *int64                     `json:"min_layer_created_at"`
	MaxLayerCreatedAt             *int64                     `json:"max_layer_created_at"`
}

Manifest represents a manifest in the API.

type Peer

type Peer struct {
	HostName string `json:"hostname"`
}

Peer represents a peer in the API.

type Repository

type Repository struct {
	Name          string `json:"name"`
	ManifestCount uint64 `json:"manifest_count"`
	TagCount      uint64 `json:"tag_count"`
	SizeBytes     uint64 `json:"size_bytes,omitempty"`
	PushedAt      int64  `json:"pushed_at,omitempty"`
}

Repository represents a repository in the API.

type SubleaseToken

type SubleaseToken struct {
	AccountName     string `json:"account"`
	PrimaryHostname string `json:"primary"`
	Secret          string `json:"secret"`
}

SubleaseToken is the internal structure of a sublease token. Only the secret is passed on to the federation driver. The other attributes are only informational. GUIs/CLIs can display these data to the user for confirmation when the token is entered.

func SubleaseTokenFromRequest

func SubleaseTokenFromRequest(r *http.Request) (SubleaseToken, error)

SubleaseTokenFromRequest parses the request's X-Keppel-Sublease-Token header.

func (SubleaseToken) Serialize

func (t SubleaseToken) Serialize() string

Serialize returns the Base64-encoded JSON of this token. This is the format that gets passed to the user.

type Tag

type Tag struct {
	Name         string `json:"name"`
	PushedAt     int64  `json:"pushed_at"`
	LastPulledAt *int64 `json:"last_pulled_at"`
}

Tag represents a tag in the API.

Jump to

Keyboard shortcuts

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