apis

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

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 DeviceDataRequest struct {
	Caption string `json:"caption"`
	Type    string `json:"type"`
}

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 Pair

type Pair struct {
	// contains filtered or unexported fields
}

func (Pair) String

func (p Pair) String() string

type PairArray

type PairArray struct {
	Pairs []Pair
}

func (PairArray) String

func (p PairArray) String() string

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 SubscriptionChanges struct {
	Add       []string             `json:"add"`
	Remove    []string             `json:"remove"`
	Timestamp *timestamp.Timestamp `json:"timestamp"`
}

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 SyncDeviceRequest struct {
	Synchronize     [][]string `json:"synchronize"`
	StopSynchronize []string   `json:"stop-synchronize"`
}

type SyncDeviceStatus added in v0.2.0

type SyncDeviceStatus struct {
	Synchronized   [][]string `json:"synchronized"`
	NotSynchronize []string   `json:"not-synchronize"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL