Documentation ¶
Index ¶
- func API2ID(tagStr string) (string, error)
- func API2Result(r PayloadResult) (payload.Result, error)
- func IDs2ListArgs(ids []string) params.Entities
- func IDs2UntrackArgs(ids []string) params.Entities
- type LookUpArg
- type LookUpArgs
- type PayloadResult
- type PayloadResults
- type SetStatusArg
- type SetStatusArgs
- type TrackArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func API2Result ¶
func API2Result(r PayloadResult) (payload.Result, error)
API2Result converts the API result to a payload.Result.
func IDs2ListArgs ¶
IDs2ListArgs converts the provided payload IDs into arguments for the List API endpoint.
func IDs2UntrackArgs ¶
IDs2UntrackArgs converts the provided payload IDs into arguments for the Untrack API endpoint.
Types ¶
type LookUpArg ¶
type LookUpArg struct { // Name is the payload name. Name string `json:"name"` // ID uniquely identifies the payload for the given name. ID string `json:"id"` }
LookUpArg contains all the information necessary to identify a payload.
type LookUpArgs ¶
type LookUpArgs struct { // Args is the list of arguments to pass to this function. Args []LookUpArg `json:"args"` }
LookUpArgs are the arguments for the LookUp endpoint.
func FullIDs2LookUpArgs ¶
func FullIDs2LookUpArgs(fullIDs []string) LookUpArgs
FullIDs2LookUpArgs converts the provided payload "full" IDs into arguments for the LookUp API endpoint.
type PayloadResult ¶
type PayloadResult struct { params.Entity // Payload holds the details of the payload, if any. Payload *api.Payload `json:"payload"` // NotFound indicates that the payload was not found in state. NotFound bool `json:"not-found"` // Error is the error (if any) for the call referring to ID. Error *params.Error `json:"error,omitempty"` }
PayloadResult contains the result for a single call.
func NewPayloadResult ¶
func NewPayloadResult(id string, err error) PayloadResult
NewPayloadResult builds a new PayloadResult from the provided tag and error. NotFound is also set based on the error.
func Result2api ¶
func Result2api(result payload.Result) PayloadResult
Result2api converts the payload.Result into a PayloadResult.
type PayloadResults ¶
type PayloadResults struct {
Results []PayloadResult `json:"results"`
}
PayloadResults is the result for a call that makes one or more requests about payloads.
type SetStatusArg ¶
type SetStatusArg struct { params.Entity // Status is the new status of the payload. Status string `json:"status"` }
SetStatusArg are the arguments for a single call to the SetStatus endpoint.
type SetStatusArgs ¶
type SetStatusArgs struct { // Args is the list of arguments to pass to this function. Args []SetStatusArg `json:"args"` }
SetStatusArgs are the arguments for the SetStatus endpoint.
func IDs2SetStatusArgs ¶
func IDs2SetStatusArgs(ids []string, status string) SetStatusArgs
IDs2SetStatusArgs converts the provided payload IDs into arguments for the SetStatus API endpoint.
type TrackArgs ¶
type TrackArgs struct { // Payloads is the list of Payloads to track Payloads []api.Payload `json:"payloads"` }
TrackArgs are the arguments for the Track endpoint.
func Payloads2TrackArgs ¶
Payloads2TrackArgs converts the provided payload info into arguments for the Track API endpoint.