handler

package
v0.0.0-...-f7a1a2b Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MetadataFilePath = "./metadata.json"

The file where the metadata will be stored

Variables

This section is empty.

Functions

func GetGithubOAuth

func GetGithubOAuth(c echo.Context, client *GitHubClient) error

func GetInfos

func GetInfos(c echo.Context) error

GetInfos returns a JSON response with the server infos

func GetLatestTags

func GetLatestTags(c echo.Context) error

Expose the /version endpoint

func GetOAuthCallback

func GetOAuthCallback(c echo.Context, client *GitHubClient) error

func PostGithubWebhook

func PostGithubWebhook(c echo.Context, client *GitHubClient) error

func SaveMetadataToFile

func SaveMetadataToFile(metadata ContainerMetadata) error

Types

type Config

type Config struct {
	Digest    string `json:"digest"`
	MediaType string `json:"media_type"`
	Size      int    `json:"size"`
}

type ContainerMetadata

type ContainerMetadata struct {
	Tag      Tag      `json:"tag"`
	Labels   Labels   `json:"labels"`
	Manifest Manifest `json:"manifest"`
}

func ReadMetadataFromFile

func ReadMetadataFromFile() (ContainerMetadata, error)

type GitHubClient

type GitHubClient struct {
	ID            string
	Secret        string
	WebhookSecret string
}

type GitHubPackageEvent

type GitHubPackageEvent struct {
	Package struct {
		PackageVersion struct {
			ContainerMetadata ContainerMetadata `json:"container_metadata"`
		} `json:"package_version"`
	} `json:"package"`
}

type Labels

type Labels struct {
	Description string            `json:"description"`
	Source      string            `json:"source"`
	Revision    string            `json:"revision"`
	ImageURL    string            `json:"image_url"`
	Licenses    string            `json:"licenses"`
	AllLabels   map[string]string `json:"all_labels"`
}

type Layer

type Layer struct {
	Digest    string `json:"digest"`
	MediaType string `json:"media_type"`
	Size      int    `json:"size"`
}

type Manifest

type Manifest struct {
	Digest    string  `json:"digest"`
	MediaType string  `json:"media_type"`
	URI       string  `json:"uri"`
	Size      int     `json:"size"`
	Config    Config  `json:"config"`
	Layers    []Layer `json:"layers"`
}

type ServerInfo

type ServerInfo struct {
	Uptime  string `json:"uptime"`
	Version string `json:"version"`
}

type ShortMetadata

type ShortMetadata struct {
	Tag struct {
		Name   string `json:"name"`
		Digest string `json:"digest"`
	} `json:"tag"`
}

func ReadShortMetadataFromFile

func ReadShortMetadataFromFile() ([]ShortMetadata, error)

type Tag

type Tag struct {
	Name   string `json:"name"`
	Digest string `json:"digest"`
}

Jump to

Keyboard shortcuts

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