handlers

package
v0.0.0-...-380335c Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2017 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

type AuthHandler struct {
	AuthSvc     pb.AuthSvcClient
	UserSvc     userpb.UserSvcClient
	Store       sessions.Store
	ContentType string
}

AuthHandler wrapper

func (*AuthHandler) HandleAuth

func (a *AuthHandler) HandleAuth(w http.ResponseWriter, r *http.Request)

HandleAuth handles GET:/auth request

func (*AuthHandler) HandleLoginURLRequest

func (a *AuthHandler) HandleLoginURLRequest(w http.ResponseWriter, r *http.Request)

HandleLoginURLRequest returns the URL for the user to login

type PointHandler

type PointHandler struct {
	ContentType string
	PointSvc    pb.PointSvcClient
}

func (*PointHandler) HandleCreate

func (p *PointHandler) HandleCreate(w http.ResponseWriter, r *http.Request)

HandleCreate handles point creation

func (*PointHandler) HandleGetFromGroup

func (p *PointHandler) HandleGetFromGroup(w http.ResponseWriter, r *http.Request)

HandleGetFromGroup get datas from a group

func (*PointHandler) HandleGetFromThings

func (p *PointHandler) HandleGetFromThings(w http.ResponseWriter, r *http.Request)

HandleGetFromThings get datas from a thing

type ThingGroupHandler

type ThingGroupHandler struct {
	ThingGroupSvc pb.ThingGroupSvcClient
	ContentType   string
}

ThingGroupHandler handles REST calls on /group

func (*ThingGroupHandler) HandleCreateGroup

func (t *ThingGroupHandler) HandleCreateGroup(w http.ResponseWriter, r *http.Request)

HandleCreateGroup handles POST#/group and sends the created group as JSON

func (*ThingGroupHandler) HandleDeleteGroup

func (t *ThingGroupHandler) HandleDeleteGroup(w http.ResponseWriter, r *http.Request)

HandleDeleteGroup handles DELETE#/group and sends the deleted id as JSON

func (*ThingGroupHandler) HandleGetGroup

func (t *ThingGroupHandler) HandleGetGroup(w http.ResponseWriter, r *http.Request)

HandleGetGroup handles GET#/group/:id and sends a group as JSON

func (*ThingGroupHandler) HandleListGroupsByUser

func (t *ThingGroupHandler) HandleListGroupsByUser(w http.ResponseWriter, r *http.Request)

func (*ThingGroupHandler) HandleUpdateGroup

func (t *ThingGroupHandler) HandleUpdateGroup(w http.ResponseWriter, r *http.Request)

HandleUpdateGroup handles PUT#/group and sends the updated group as JSON

type ThingHandler

type ThingHandler struct {
	ThingSvc    tpb.ThingSvcClient
	ContentType string
}

ThingHandler handles /thing REST requests

func (*ThingHandler) HandleCreateThing

func (t *ThingHandler) HandleCreateThing(w http.ResponseWriter, r *http.Request)

HandleCreateThing handles thing creation on POST:/thing

func (*ThingHandler) HandleDeleteManyThings

func (t *ThingHandler) HandleDeleteManyThings(w http.ResponseWriter, r *http.Request)

HandleDeleteManyThings handles thing bulk delete on DELETE#/thing/many

func (*ThingHandler) HandleDeleteOneThing

func (t *ThingHandler) HandleDeleteOneThing(w http.ResponseWriter, r *http.Request)

HandleDeleteOneThing handles thing delete on DELETE#/thing/one/:id

func (*ThingHandler) HandleGetThing

func (t *ThingHandler) HandleGetThing(w http.ResponseWriter, r *http.Request)

HandleGetThing handles GET:/thing/:id requests

func (*ThingHandler) HandleListThings

func (t *ThingHandler) HandleListThings(w http.ResponseWriter, r *http.Request)

HandleListThings returns a list of things as JSON fetched from thing service

func (*ThingHandler) HandleUpdateThing

func (t *ThingHandler) HandleUpdateThing(w http.ResponseWriter, r *http.Request)

HandleUpdateThing handles thing update on PUT#/thing

type UserHandler

type UserHandler struct {
	UserSvc     pb.UserSvcClient
	ContentType string
}

UserHandler handle /user REST requests

func (*UserHandler) HandleCreateUser

func (u *UserHandler) HandleCreateUser(w http.ResponseWriter, r *http.Request)

HandleCreateUser is used on POST:/user and returns the created user as JSON

func (*UserHandler) HandleDeleteUser

func (u *UserHandler) HandleDeleteUser(w http.ResponseWriter, r *http.Request)

HandleDeleteUser is used on DELETE:/user/:id and returns the deletion state & deleted id

func (*UserHandler) HandleGetUser

func (u *UserHandler) HandleGetUser(w http.ResponseWriter, r *http.Request)

HandleGetUser is used on GET:/user and returns a user as JSON

Jump to

Keyboard shortcuts

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