Documentation ¶
Index ¶
- type PayloadAPIClient
- type PayloadsHookContext
- func (c *PayloadsHookContext) FlushPayloads(ctx context.Context) error
- func (c *PayloadsHookContext) GetPayload(class, id string) (*corepayloads.Payload, error)
- func (c *PayloadsHookContext) ListPayloads() ([]string, error)
- func (c *PayloadsHookContext) Payloads() ([]corepayloads.Payload, error)
- func (c *PayloadsHookContext) SetPayloadStatus(ctx context.Context, class, id, status string) error
- func (c *PayloadsHookContext) TrackPayload(pl corepayloads.Payload) error
- func (c *PayloadsHookContext) UntrackPayload(ctx context.Context, class, id string) error
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(ctx context.Context, fullIDs ...string) ([]corepayloads.Result, error) // Track sends a request to update state with the provided payloads. Track(ctx context.Context, payloads ...corepayloads.Payload) ([]corepayloads.Result, error) // Untrack removes the payloads from our list track. Untrack(ctx context.Context, fullIDs ...string) ([]corepayloads.Result, error) // SetStatus sets the status for the given IDs. SetStatus(ctx context.Context, 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(ctx context.Context, client PayloadAPIClient) (*PayloadsHookContext, error)
NewContext returns a new hooks.PayloadsHookContext for payloads.
func (*PayloadsHookContext) FlushPayloads ¶
func (c *PayloadsHookContext) FlushPayloads(ctx context.Context) 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(ctx context.Context, 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(ctx context.Context, class, id string) error
UntrackPayload tells juju to stop tracking this payload.