registry

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFunctionNotFound = errors.New("function not found")
	ErrTagNotFound      = errors.New("tag not found")
	ErrDigestNotFound   = errors.New("digest not found")
	ErrInvalidReference = errors.New("invalid reference format")
	ErrVersionNotFound  = errors.New("version not found")
)

Functions

func AddTagToVersion

func AddTagToVersion(versions *[]VersionInfo, shortDigest, tag string)

func HasTag

func HasTag(tags []string, tag string) bool

func RemoveTag

func RemoveTag(tags []string, tagToRemove string) []string

func RemoveTagFromVersions

func RemoveTagFromVersions(versions *[]VersionInfo, tag string)

func TruncateDigest

func TruncateDigest(digest string, length int) string

Types

type FunctionMetadata

type FunctionMetadata struct {
	Namespace string                 `json:"namespace"`
	Name      string                 `json:"name"`
	CreatedAt time.Time              `json:"created_at"`
	UpdatedAt time.Time              `json:"updated_at"`
	Versions  []VersionInfo          `json:"versions"`
	Config    map[string]interface{} `json:"config"`
}

type Registry

type Registry interface {
	Get(namespace, name string) (*FunctionMetadata, error)
	Push(namespace, name string, payload []byte, digest, tag string, config manifest.FunctionVersionSettings) error
	Pull(namespace, name string, version string) ([]byte, *VersionInfo, error)
	ReassignTag(namespace, name, tag, newDigest string) error
	DigestExists(namespace, name, digest string) (bool, error)
	ListAll() ([]FunctionMetadata, error)
}

type Storage

type Storage interface {
	ReadWASMFile(path string) ([]byte, error)
	WriteWASMFile(path string, data []byte) error
	BuildWASMPath(namespace, name, shortDigest string) string
}

type VersionInfo

type VersionInfo struct {
	Hash       string                           `json:"hash"`
	FullDigest string                           `json:"full_digest"`
	CreatedAt  time.Time                        `json:"created_at"`
	Size       int64                            `json:"size"`
	Tags       []string                         `json:"tags"`
	Settings   manifest.FunctionVersionSettings `json:"settings"`
}

func CreateVersionInfo

func CreateVersionInfo(shortDigest, fullDigest string, payload []byte, tag string, settings manifest.FunctionVersionSettings) VersionInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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