model

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 12 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
}

func (*Bundle) Validate

func (b *Bundle) Validate() error

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 (m *Package) Validate() error

type RelatedImage

type RelatedImage struct {
	Name  string
	Image string
}

func (RelatedImage) Validate

func (i RelatedImage) Validate() error

Jump to

Keyboard shortcuts

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