Documentation ¶
Index ¶
- Constants
- func Device(st *state.State) (*auth.DeviceState, error)
- func MockDeviceService(c *C, bhv *DeviceServiceBehavior) *httptest.Server
- func MockGadget(c *C, st *state.State, name string, revision snap.Revision, ...) (restore func())
- func SetDevice(st *state.State, device *auth.DeviceState) error
- type DeviceServiceBehavior
- type PrepareDeviceBehavior
Constants ¶
View Source
const ( ReqIDFailID501 = "REQID-FAIL-ID-501" ReqIDBadRequest = "REQID-BAD-REQ" ReqIDPoll = "REQID-POLL" ReqIDSerialWithBadModel = "REQID-SERIAL-W-BAD-MODEL" )
Request IDs for hard-coded behaviors.
Variables ¶
This section is empty.
Functions ¶
func MockDeviceService ¶
func MockDeviceService(c *C, bhv *DeviceServiceBehavior) *httptest.Server
func MockGadget ¶
Types ¶
type DeviceServiceBehavior ¶
type DeviceServiceBehavior struct { ReqID string RequestIDURLPath string SerialURLPath string ExpectedCapabilities string Head func(c *C, bhv *DeviceServiceBehavior, w http.ResponseWriter, r *http.Request) PostPreflight func(c *C, bhv *DeviceServiceBehavior, w http.ResponseWriter, r *http.Request) SignSerial func(c *C, bhv *DeviceServiceBehavior, headers map[string]interface{}, body []byte) (serial asserts.Assertion, ancillary []asserts.Assertion, err error) }
Click to show internal directories.
Click to hide internal directories.