Documentation
¶
Index ¶
- Constants
- func EncodeError(ctx context.Context, err error, w http.ResponseWriter)
- func MakeCheckinEndpoint(svc Service) endpoint.Endpoint
- func MarshalEvent(e *Event) ([]byte, error)
- func UnmarshalEvent(data []byte, e *Event) error
- type Checkin
- type Endpoints
- type Event
- type HTTPHandlers
- type Service
Constants ¶
View Source
const ( AuthenticateTopic = "mdm.Authenticate" TokenUpdateTopic = "mdm.TokenUpdate" CheckoutTopic = "mdm.CheckOut" )
PubSub Topics where MDM Checkin events are published to.
View Source
const CheckinBucket = "mdm.Checkin.ARCHIVE"
CheckinBucket is the *bolt.DB bucket where checkins are archived.
Variables ¶
This section is empty.
Functions ¶
func EncodeError ¶
func EncodeError(ctx context.Context, err error, w http.ResponseWriter)
EncodeError is used by the HTTP transport to encode service errors in HTTP. The EncodeError should be passed to the Go-Kit httptransport as the ServerErrorEncoder to encode error responses. According to the MDM Check-in protocol specification, the device only needs a 401 (Unauthorized) response in case of failure.
func MakeCheckinEndpoint ¶
func MarshalEvent ¶
MarshalEvent serializes an event to a protocol buffer wire format.
func UnmarshalEvent ¶
UnmarshalEvent parses a protocol buffer representation of data into the Event.
Types ¶
type Checkin ¶
type Checkin struct {
// contains filtered or unexported fields
}
func (*Checkin) Authenticate ¶
func (*Checkin) TokenUpdate ¶
type Event ¶
type Event struct {
ID string
Time time.Time
Command mdm.CheckinCommand
}
func NewEvent ¶
func NewEvent(cmd mdm.CheckinCommand) *Event
NewEvent returns an Event with a unique ID and the current time.
type HTTPHandlers ¶
type HTTPHandlers struct {
// The CheckinHandler should accept PUT requests
CheckinHandler http.Handler
}
func MakeHTTPHandlers ¶
func MakeHTTPHandlers(ctx context.Context, endpoints Endpoints, opts ...httptransport.ServerOption) HTTPHandlers
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
checkinproto
Package checkinproto is a generated protocol buffer package.
|
Package checkinproto is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.