charm

package
v0.0.0-...-0a82276 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Origin

type Origin struct {
	// Source is where the charm came from, Local, CharmStore or CharmHub.
	Source OriginSource
	// Type defines the charm type if it's a bundle or a charm
	Type string
	// ID is the CharmHub ID for this charm.
	ID string
	// Hash is the hash of the charm intended to be used.
	Hash string
	// Risk is the CharmHub channel risk, or the CharmStore channel value.
	Risk string
	// Revision is the charm revision number.
	Revision *int
	// Track is a CharmHub channel track.
	Track *string
	// Branch is the CharmHub channel branch
	Branch *string
	// Architecture describes the architecture intended to be used by the charm.
	Architecture string
	// Base describes the OS base intended to be used by the charm.
	Base corebase.Base

	// InstanceKey is a unique string associated with the application. To
	// assist with keeping KPI data in charmhub, it must be the same for every
	// charmhub Refresh action related to an application. Create with the
	// charmhub.CreateInstanceKey method. LP: 1944582
	InstanceKey string
}

Origin holds the information about where the charm originates.

func APICharmOrigin

func APICharmOrigin(origin params.CharmOrigin) (Origin, error)

APICharmOrigin is a helper function to convert params.CharmOrigin to an Origin.

func CoreCharmOrigin

func CoreCharmOrigin(origin corecharm.Origin) (Origin, error)

CoreCharmOrigin is a helper function to convert params.CharmOrigin to an Origin.

func (Origin) CharmChannel

func (o Origin) CharmChannel() charm.Channel

CharmChannel returns the channel indicated by this origin.

func (Origin) CoreCharmOrigin

func (o Origin) CoreCharmOrigin() corecharm.Origin

CoreCharmOrigin is a help method to get a core version of this structure.

func (Origin) ParamsCharmOrigin

func (o Origin) ParamsCharmOrigin() params.CharmOrigin

ParamsCharmOrigin is a helper method to get a params version of this structure.

func (Origin) WithBase

func (o Origin) WithBase(b *corebase.Base) Origin

WithBase allows to update the base of an origin.

type OriginSource

type OriginSource string

OriginSource represents the source of the charm.

const (
	// OriginLocal represents a local charm.
	OriginLocal OriginSource = "local"
	// OriginCharmHub represents a charm from the new charm-hub.
	OriginCharmHub OriginSource = "charm-hub"
)

func (OriginSource) String

func (c OriginSource) String() string

Jump to

Keyboard shortcuts

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