model

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 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

	// 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
	// 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 Icon

type Icon struct {
	Data      []byte
	MediaType string
}

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
}

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