files

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BomConfig

type BomConfig struct {
	Components map[string]ComponentConfig `json:"components"`
	Migrations MigrationsConfig           `json:"migrations"`
}

BomConfig represents the Bill of Materials configuration

func (*BomConfig) GetCodesphereContainerImages

func (b *BomConfig) GetCodesphereContainerImages() (map[string]string, error)

GetCodesphereContainerImages returns all container images from the codesphere component

func (*BomConfig) ParseBomConfig

func (b *BomConfig) ParseBomConfig(filePath string) error

ParseBomConfig reads and parses a BOM JSON file

type CodesphereComponent

type CodesphereComponent struct {
	ContainerImages map[string]string  `json:"containerImages"`
	Files           map[string]FileRef `json:"files"`
}

CodesphereComponent represents the codesphere-specific component

type CodesphereConfig

type CodesphereConfig struct {
	DeployConfig DeployConfig `yaml:"deployConfig"`
}

type ComponentConfig

type ComponentConfig struct {
	ContainerImages map[string]string  `json:"containerImages,omitempty"`
	Files           map[string]FileRef `json:"files,omitempty"`
}

ComponentConfig represents a component in the BOM

type DbMigrationConfig

type DbMigrationConfig struct {
	Path string `json:"path"`
	From string `json:"from"`
}

DbMigrationConfig represents database migration configuration

type DeployConfig

type DeployConfig struct {
	Images map[string]ImageConfig `yaml:"images"`
}

type FileRef

type FileRef struct {
	SrcPath    string   `json:"srcPath,omitempty"`
	SrcUrl     string   `json:"srcUrl,omitempty"`
	Executable bool     `json:"executable,omitempty"`
	Glob       *GlobRef `json:"glob,omitempty"`
}

FileRef represents a file reference in the BOM

type FlavorConfig

type FlavorConfig struct {
	Image ImageRef    `yaml:"image"`
	Pool  map[int]int `yaml:"pool"`
}

type GlobRef

type GlobRef struct {
	Cwd     string   `json:"cwd"`
	Include string   `json:"include"`
	Exclude []string `json:"exclude,omitempty"`
}

GlobRef represents a glob-based file reference

type ImageConfig

type ImageConfig struct {
	Name           string                  `yaml:"name"`
	SupportedUntil string                  `yaml:"supportedUntil"`
	Flavors        map[string]FlavorConfig `yaml:"flavors"`
}

type ImageRef

type ImageRef struct {
	BomRef     string `yaml:"bomRef"`
	Dockerfile string `yaml:"dockerfile"`
}

type ManifestEntry

type ManifestEntry struct {
	MediaType   string            `json:"mediaType"`
	Digest      string            `json:"digest"`
	Size        int64             `json:"size"`
	Annotations map[string]string `json:"annotations,omitempty"` // Use omitempty just in case, though usually present
}

ManifestEntry represents a single manifest entry within the index.

type MigrationsConfig

type MigrationsConfig struct {
	Db DbMigrationConfig `json:"db"`
}

MigrationsConfig represents the migrations configuration

type OCIImageIndex

type OCIImageIndex struct {
	SchemaVersion int             `json:"schemaVersion"`
	MediaType     string          `json:"mediaType"`
	Manifests     []ManifestEntry `json:"manifests"`
}

OCIImageIndex represents the top-level structure of an OCI Image Index (manifest list).

func (*OCIImageIndex) ExtractImageNames

func (o *OCIImageIndex) ExtractImageNames() ([]string, error)

ExtractImageNames extracts the image names from the OCI image index file.

func (*OCIImageIndex) ParseOCIImageConfig

func (o *OCIImageIndex) ParseOCIImageConfig(filePath string) error

type RegistryConfig

type RegistryConfig struct {
	Server string `yaml:"server"`
}

type RootConfig

type RootConfig struct {
	Registry   RegistryConfig   `yaml:"registry"`
	Codesphere CodesphereConfig `yaml:"codesphere"`
}

RootConfig represents the relevant parts of the configuration file

func (*RootConfig) ExtractBomRefs

func (c *RootConfig) ExtractBomRefs() []string

func (*RootConfig) ExtractWorkspaceDockerfiles

func (c *RootConfig) ExtractWorkspaceDockerfiles() map[string]string

func (*RootConfig) ParseConfig

func (c *RootConfig) ParseConfig(filePath string) error

Jump to

Keyboard shortcuts

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