Documentation ¶
Index ¶
- type DeviceAPI
- type DeviceDataRequest
- type EpisodeAPI
- type EpisodeActionOutput
- type Pair
- type PairArray
- type SubscriptionAPI
- func (s *SubscriptionAPI) HandleDeviceSubscriptionChange(w http.ResponseWriter, r *http.Request)
- func (s *SubscriptionAPI) HandleGetDeviceSubscription(w http.ResponseWriter, r *http.Request)
- func (s *SubscriptionAPI) HandleGetDeviceSubscriptionChange(w http.ResponseWriter, r *http.Request)
- func (s *SubscriptionAPI) HandleGetSubscription(w http.ResponseWriter, r *http.Request)
- func (s *SubscriptionAPI) HandleUploadDeviceSubscription(w http.ResponseWriter, r *http.Request)
- func (s *SubscriptionAPI) HandleUploadDeviceSubscriptionChange(w http.ResponseWriter, r *http.Request)
- type SubscriptionChangeOutput
- type SubscriptionChanges
- type SyncAPI
- type SyncDeviceRequest
- type SyncDeviceStatus
- type UserAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceAPI ¶
type DeviceAPI struct { Store store.Store Data data.DataInterface }
func (*DeviceAPI) HandleGetDevices ¶
func (d *DeviceAPI) HandleGetDevices(w http.ResponseWriter, r *http.Request)
func (*DeviceAPI) HandleUpdateDevice ¶
func (d *DeviceAPI) HandleUpdateDevice(w http.ResponseWriter, r *http.Request)
DeviceAPI
type DeviceDataRequest ¶
type EpisodeAPI ¶
type EpisodeAPI struct { Store store.Store Data data.DataInterface }
func (*EpisodeAPI) HandleEpisodeAction ¶
func (e *EpisodeAPI) HandleEpisodeAction(w http.ResponseWriter, r *http.Request)
func (*EpisodeAPI) HandleUploadEpisodeAction ¶
func (e *EpisodeAPI) HandleUploadEpisodeAction(w http.ResponseWriter, r *http.Request)
POST /api/2/episodes/{username}.json
type EpisodeActionOutput ¶
type EpisodeActionOutput struct { Actions []data.EpisodeAction `json:"actions"` Timestamp *timestamp.Timestamp `json:"timestamp"` }
type SubscriptionAPI ¶
type SubscriptionAPI struct { Store store.Store Data data.DataInterface }
func (*SubscriptionAPI) HandleDeviceSubscriptionChange ¶
func (s *SubscriptionAPI) HandleDeviceSubscriptionChange(w http.ResponseWriter, r *http.Request)
TODO: Handle Device Subscription Change
func (*SubscriptionAPI) HandleGetDeviceSubscription ¶
func (s *SubscriptionAPI) HandleGetDeviceSubscription(w http.ResponseWriter, r *http.Request)
func (*SubscriptionAPI) HandleGetDeviceSubscriptionChange ¶
func (s *SubscriptionAPI) HandleGetDeviceSubscriptionChange(w http.ResponseWriter, r *http.Request)
API Endpoint: GET /api/2/subscriptions/{username}/{deviceid}.json
func (*SubscriptionAPI) HandleGetSubscription ¶
func (s *SubscriptionAPI) HandleGetSubscription(w http.ResponseWriter, r *http.Request)
func (*SubscriptionAPI) HandleUploadDeviceSubscription ¶
func (s *SubscriptionAPI) HandleUploadDeviceSubscription(w http.ResponseWriter, r *http.Request)
API Endpoint: POST and PUT /subscriptions/{username}/{deviceid}.{format}
func (*SubscriptionAPI) HandleUploadDeviceSubscriptionChange ¶
func (s *SubscriptionAPI) HandleUploadDeviceSubscriptionChange(w http.ResponseWriter, r *http.Request)
API Endpoint: POST /api/2/subscriptions/{username}/{deviceid}.{format}
type SubscriptionChangeOutput ¶
type SubscriptionChangeOutput struct { Timestamp *timestamp.Timestamp `json:"timestamp"` UpdateUrls json.RawMessage `json:"update_urls"` }
type SubscriptionChanges ¶
type SyncAPI ¶ added in v0.2.0
type SyncAPI struct { Data data.DataInterface // contains filtered or unexported fields }
func NewSyncAPI ¶ added in v0.2.0
func NewSyncAPI(data data.DataInterface, verifierSecretKey string) *SyncAPI
func (*SyncAPI) HandleGetSync ¶ added in v0.2.0
func (s *SyncAPI) HandleGetSync(w http.ResponseWriter, r *http.Request)
GET /api/2/sync-devices/{username}.json
func (*SyncAPI) HandlePostSync ¶ added in v0.2.0
func (s *SyncAPI) HandlePostSync(w http.ResponseWriter, r *http.Request)
POST /api/2/sync-devices/{username}.json This endpoints takes in a SyncDeviceRequest to link up devices together
type SyncDeviceRequest ¶ added in v0.2.0
type SyncDeviceStatus ¶ added in v0.2.0
type UserAPI ¶
type UserAPI struct { Data data.DataInterface // contains filtered or unexported fields }
func NewUserAPI ¶
func NewUserAPI(data data.DataInterface, verifierSecretKey string) *UserAPI
func (*UserAPI) HandleLogin ¶
func (u *UserAPI) HandleLogin(w http.ResponseWriter, r *http.Request)
HandleLogin uses Basic Auth to check on a user's credentials and return a cookie session that will be used for subsequent calls
func (*UserAPI) HandleUserCreate ¶
func (u *UserAPI) HandleUserCreate(w http.ResponseWriter, r *http.Request)
HandleUserCreate takes in a username and password AND must only be able to be run on the same instance as the API Server