resourceshookcontext

package
v0.0.0-...-f88c608 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type ApplicationService

type ApplicationService interface {
	// GetApplicationIDByName returns an application ID by application name. It
	// returns an error if the application can not be found by the name.
	GetApplicationIDByName(ctx context.Context, name string) (coreapplication.ID, error)

	// GetApplicationIDByUnitName returns the application ID for the named unit. It
	// returns an error if the unit is not found by the name
	GetApplicationIDByUnitName(ctx context.Context, unitName coreunit.Name) (coreapplication.ID, error)
}

ApplicationService defines operations to retrieve application IDs based on application or unit names.

type ResourceService

type ResourceService interface {

	// GetResourcesByApplicationID retrieves all resources associated with a given application ID in the specified context.
	GetResourcesByApplicationID(ctx context.Context, applicationID coreapplication.ID) ([]coreresource.Resource,
		error)
}

ResourceService provides methods for managing resource data related to applications.

type UnitFacade

type UnitFacade struct {
	// contains filtered or unexported fields
}

UnitFacade is the resources portion of the uniter's API facade.

func NewUnitFacade

func NewUnitFacade(
	appOrUnitTag names.Tag,
	applicationService ApplicationService,
	resourceService ResourceService,
) (*UnitFacade, error)

NewUnitFacade returns the resources portion of the uniter's API facade.

func (*UnitFacade) GetResourceInfo

GetResourceInfo returns the resource info for each of the given resource names (for the implicit application). If any one is missing then the corresponding result is set with errors.NotFound.

Jump to

Keyboard shortcuts

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