Documentation ¶
Index ¶
- func Register(registry facade.FacadeRegistry)
- func Result2api(result payloads.Result) params.PayloadResult
- type UnitFacade
- func (uf UnitFacade) List(ctx context.Context, args params.Entities) (params.PayloadResults, error)
- func (uf UnitFacade) LookUp(ctx context.Context, args params.LookUpPayloadArgs) (params.PayloadResults, error)
- func (uf UnitFacade) SetStatus(ctx context.Context, args params.SetPayloadStatusArgs) (params.PayloadResults, error)
- func (uf UnitFacade) Track(ctx context.Context, args params.TrackPayloadArgs) (params.PayloadResults, error)
- func (uf UnitFacade) Untrack(ctx context.Context, args params.Entities) (params.PayloadResults, error)
- type UnitPayloadBackend
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.
func Result2api ¶
func Result2api(result payloads.Result) params.PayloadResult
Result2api converts the payloads.Result into a PayloadResult.
Types ¶
type UnitFacade ¶
type UnitFacade struct {
// contains filtered or unexported fields
}
UnitFacade serves payload-specific API methods.
func NewHookContextFacade ¶
func NewHookContextFacade(st *state.State, unit *state.Unit, logger logger.Logger) (*UnitFacade, error)
NewHookContextFacade returns a new payloads hook context facade for the State and Unit given. It is used for facade registration.
func NewUnitFacade ¶
func NewUnitFacade(backend UnitPayloadBackend, logger logger.Logger) *UnitFacade
NewUnitFacade builds a new facade for the given backend.
func (UnitFacade) List ¶
func (uf UnitFacade) List(ctx context.Context, args params.Entities) (params.PayloadResults, error)
List builds the list of payload being tracked for the given unit and IDs. If no IDs are provided then all tracked payloads for the unit are returned.
func (UnitFacade) LookUp ¶
func (uf UnitFacade) LookUp(ctx context.Context, args params.LookUpPayloadArgs) (params.PayloadResults, error)
LookUp identifies the payload with the provided name and raw ID.
func (UnitFacade) SetStatus ¶
func (uf UnitFacade) SetStatus(ctx context.Context, args params.SetPayloadStatusArgs) (params.PayloadResults, error)
SetStatus sets the raw status of a payload.
func (UnitFacade) Track ¶
func (uf UnitFacade) Track(ctx context.Context, args params.TrackPayloadArgs) (params.PayloadResults, error)
Track stores a payload to be tracked in state.
func (UnitFacade) Untrack ¶
func (uf UnitFacade) Untrack(ctx context.Context, args params.Entities) (params.PayloadResults, error)
Untrack marks the identified payload as no longer being tracked.
type UnitPayloadBackend ¶
type UnitPayloadBackend interface { // Track tracks a payload for the unit and info. Track(info payloads.Payload) error // List returns information on the payload with the id on the unit. List(ids ...string) ([]payloads.Result, error) // SetStatus sets the status for the payload with the given id on the unit. SetStatus(id, status string) error // LookUp returns the payload ID for the given name/rawID pair. LookUp(name, rawID string) (string, error) // Untrack removes the information for the payload with the given id. Untrack(id string) error }
UnitPayloadBackend exposes the State functionality for a unit's payloads.