Documentation
¶
Index ¶
- Constants
- Variables
- func AwaitCompletion(ctx context.Context, a types.API, o objectWithStateRetriever) error
- func EndpointURL(ctx context.Context, obj types.Object, resourcePath string) (*url.URL, error)
- func RequestBody(ctx context.Context, br func() interface{}) (interface{}, error)
- type GenericService
- type HasState
- type PartialResourceList
- type State
- type StateRetriever
Constants ¶
const ( // StateTypeError is used for states of type error StateTypeError = 0 // StateTypeOK is used for states of type OK StateTypeOK = 1 // StateTypePending is used for states of type Pending StateTypePending = 2 )
State types defined for GS resources by the Engine
Variables ¶
var ( // ErrStateError is returned if a resource could not be provisioned (state "Error") ErrStateError = errors.New("resource is in an error state") // ErrStateUnknown is returned if a resource has an unknown state ErrStateUnknown = errors.New("resource is in an unknown state") )
Functions ¶
func AwaitCompletion ¶
AwaitCompletion blocks until an object is no longer pending
func EndpointURL ¶ added in v0.6.0
EndpointURL is a helper function which can be wrapped by API bindings to enable the filter helper
func RequestBody ¶ added in v0.6.0
RequestBody prevents decoding of delete responses as they are not compatible with the objects type
Types ¶
type GenericService ¶
type GenericService struct{}
GenericService has methods overridden for all GS objects in the same way
func (*GenericService) FilterAPIResponse ¶
func (gs *GenericService) FilterAPIResponse(ctx context.Context, res *http.Response) (*http.Response, error)
FilterAPIResponse replaces the API response with an empty json object
type HasState ¶
type HasState struct {
State State `json:"state"`
}
func (HasState) StateError ¶
StateError checks if the state is marking any failure
func (HasState) StatePending ¶
StatePending checks if the state is marking any change currently being applied
type PartialResourceList ¶ added in v0.5.1
type PartialResourceList []common.PartialResource
PartialResourceList represents a linked resource list in GS
func (PartialResourceList) MarshalJSON ¶ added in v0.5.1
func (prl PartialResourceList) MarshalJSON() ([]byte, error)
MarshalJSON unfolds the resources to their identifier as a comma-separated string
type State ¶
type State struct { // programatically usable enum value ID string `json:"id"` // human readable status text Text string `json:"text"` Type int `json:"type"` }
State represents the state object available on GS resources
func (State) MarshalJSON ¶
func (State) StateError ¶
StateError checks if the state is marking any failure
func (State) StatePending ¶
StatePending checks if the state is marking any change currently being applied
type StateRetriever ¶
StateRetriever is an interface Objects can implement to provide unified state information