payloads

package
v0.0.0-...-51a0f74 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PayloadAPIClient

type PayloadAPIClient interface {
	// List requests the payload info for the given IDs.
	List(fullIDs ...string) ([]corepayloads.Result, error)
	// Track sends a request to update state with the provided payloads.
	Track(payloads ...corepayloads.Payload) ([]corepayloads.Result, error)
	// Untrack removes the payloads from our list track.
	Untrack(fullIDs ...string) ([]corepayloads.Result, error)
	// SetStatus sets the status for the given IDs.
	SetStatus(status string, fullIDs ...string) ([]corepayloads.Result, error)
}

PayloadAPIClient represents the API needs of a PayloadContext.

type PayloadsHookContext

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

PayloadsHookContext is the implementation of runner.ContextPayloads.

func NewContext

func NewContext(client PayloadAPIClient) (*PayloadsHookContext, error)

NewContext returns a new hooks.PayloadsHookContext for payloads.

func (*PayloadsHookContext) FlushPayloads

func (c *PayloadsHookContext) FlushPayloads() error

FlushPayloads implements context.ContextPayloads. In this case that means all added and updated payloads.Payload in the hook context are pushed to Juju state via the API.

func (*PayloadsHookContext) GetPayload

func (c *PayloadsHookContext) GetPayload(class, id string) (*corepayloads.Payload, error)

GetPayload returns the payload info corresponding to the given ID.

func (*PayloadsHookContext) ListPayloads

func (c *PayloadsHookContext) ListPayloads() ([]string, error)

ListPayloads returns the sorted names of all registered payloads.

func (*PayloadsHookContext) Payloads

func (c *PayloadsHookContext) Payloads() ([]corepayloads.Payload, error)

Payloads returns the payloads known to the context.

func (*PayloadsHookContext) SetPayloadStatus

func (c *PayloadsHookContext) SetPayloadStatus(class, id, status string) error

SetPayloadStatus sets the identified payload's status.

func (*PayloadsHookContext) TrackPayload

func (c *PayloadsHookContext) TrackPayload(pl corepayloads.Payload) error

TrackPayload records the payload info in the hook context.

func (*PayloadsHookContext) UntrackPayload

func (c *PayloadsHookContext) UntrackPayload(class, id string) error

UntrackPayload tells juju to stop tracking this payload.

Jump to

Keyboard shortcuts

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