Help us shape the future of Go! Take the 2026 Go Developer Survey

model

package
v1.73.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	Package       *Package
	Channel       *Channel
	Name          string
	Image         string
	Replaces      string
	Skips         []string
	SkipRange     string
	Properties    []property.Property
	RelatedImages []RelatedImage
	Deprecation   *Deprecation

	// These fields are present so that we can continue serving
	// the GRPC API the way packageserver expects us to in a
	// backwards-compatible way.
	Objects []string
	CsvJSON string

	// These fields are used to compare bundles in a diff.
	PropertiesP *property.Properties
	Version     semver.Version
	Release     semver.Version
}

func (*Bundle) Compare added in v1.62.0

func (b *Bundle) Compare(other *Bundle) int

order by version, then release, if present

func (*Bundle) Validate

func (b *Bundle) Validate() error

func (*Bundle) VersionString added in v1.62.0

func (b *Bundle) VersionString() string

type Channel

type Channel struct {
	Package     *Package
	Name        string
	Bundles     map[string]*Bundle
	Deprecation *Deprecation
	// NOTICE: The field Properties of the type Channel is for internal use only.
	//   DO NOT use it for any public-facing functionalities.
	//   This API is in alpha stage and it is subject to change.
	Properties []property.Property
}

func (Channel) Head

func (c Channel) Head() (*Bundle, error)

TODO(joelanford): This function determines the channel head by finding the bundle that has 0

incoming edges, based on replaces and skips. It also expects to find exactly one such bundle.
Is this the correct algorithm?

func (*Channel) Validate

func (c *Channel) Validate() error

type Deprecation added in v1.32.0

type Deprecation struct {
	Message string `json:"message"`
}

func (*Deprecation) Validate added in v1.32.0

func (d *Deprecation) Validate() error

type Icon

type Icon struct {
	Data      []byte `json:"base64data"`
	MediaType string `json:"mediatype"`
}

func (*Icon) Validate

func (i *Icon) Validate() error

type Model

type Model map[string]*Package

func (Model) AddBundle

func (m Model) AddBundle(b Bundle)

func (Model) Normalize

func (m Model) Normalize()

func (Model) Validate

func (m Model) Validate() error

type Package

type Package struct {
	Name           string
	Description    string
	Icon           *Icon
	DefaultChannel *Channel
	Channels       map[string]*Channel
	Deprecation    *Deprecation
}

func (*Package) Validate

func (p *Package) Validate() error

type RelatedImage

type RelatedImage struct {
	Name  string
	Image string
}

func (RelatedImage) Validate

func (i RelatedImage) Validate() error

type Release added in v1.68.0

type Release []semver.PRVersion

Release represents a pre-release version identifier using period-delimited segments. Each segment follows semver pre-release rules: alphanumerics and hyphens only, no leading zeros in numeric identifiers. A nil Release represents "no release" and serializes to an empty string in JSON. Use nil (not an empty slice) to represent the absence of a release.

func NewRelease added in v1.68.0

func NewRelease(relStr string) (Release, error)

func (Release) Compare added in v1.68.0

func (r Release) Compare(other Release) int

Compare compares two Release instances a non-zero release is always "greater than" a zero-length release otherwise, compares segment by segment using semver pre-release comparison rules

func (Release) MarshalJSON added in v1.68.0

func (r Release) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Release. It serializes the Release as a period-delimited string.

func (Release) String added in v1.68.0

func (r Release) String() string

String returns the string representation of the release version.

func (*Release) UnmarshalJSON added in v1.68.0

func (r *Release) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Release. It deserializes a period-delimited string into a Release.

type VersionRelease added in v1.68.0

type VersionRelease struct {
	Version semver.Version `json:"version"`
	Release Release        `json:"release"`
}

VersionRelease combines a semver Version with an optional Release identifier. JSON serialization format:

  • Version is serialized using standard semver format
  • Release is always included as a string field (empty string if nil)
  • Example: {"version":"1.2.3","release":"alpha.1"}
  • Example: {"version":"1.2.3","release":""}

func (*VersionRelease) Compare added in v1.68.0

func (vr *VersionRelease) Compare(other *VersionRelease) int

func (*VersionRelease) KubernetesSafeString added in v1.68.0

func (vr *VersionRelease) KubernetesSafeString() string

KubernetesSafeString returns the safe string representation of the version release suitable for use as a metadata.name this generation is not round-trippable (i.e. cannot be parsed back into the original VersionRelease)

Jump to

Keyboard shortcuts

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