actions

package
v0.0.0-...-158de82 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2019 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ENV = envy.Get("GO_ENV", "development")

ENV is used to help switch settings based on where the application is being run. Default is "development".

Functions

func AboutHandler

func AboutHandler(c buffalo.Context) error

AboutHandler is a default handler to serve up memory of 18.20.

func App

func App() *buffalo.App

App is where all routes and middleware for buffalo should be defined. This is the nerve center of your application.

func AuthMiddleware

func AuthMiddleware(next buffalo.Handler) buffalo.Handler

AuthMiddleware is an Authorization middleware using JWT. it validates access tokens and checks their expiration time.

func DMHealthHandler

func DMHealthHandler(c buffalo.Context) error

DMHealthHandler checks status of dm service. This function is mapped to the path GET /health/dm

func NewAccessToken

func NewAccessToken(u models.User) (string, error)

NewAccessToken creates new access token for given user.

func NewRefreshToken

func NewRefreshToken(id string, untilExpire time.Duration) (string, error)

NewRefreshToken creates new refresh token for given identification that does not expire until time.Now() + untilExpire.

func PMHealthHandler

func PMHealthHandler(c buffalo.Context) error

PMHealthHandler checks status of pm service. This function is mapped to the path GET /health/pm

func QueryHandler

func QueryHandler(c buffalo.Context) error

QueryHandler handles data queries in dm. This function is mapped to the path ANY /projects/{project_id}/things/{thing_id}/queries/{path:.+}

func WFHandler

func WFHandler(c buffalo.Context) error

WFHandler handles weather forcecasting requests by proxies them to wf component. This function is mapped to the path POST /wf/{service}

func WFHealthHandler

func WFHealthHandler(c buffalo.Context) error

WFHealthHandler checks status of wf service. This function is mapped to the path GET /health/wf

Types

type AdditionalsResource

type AdditionalsResource struct {
}

AdditionalsResource contronls additional information on users.

func (AdditionalsResource) Create

Create creates new key on user additional information. Please note that you cannot store array on additional information field. This function is mapped to the path POST /info/{key}

func (AdditionalsResource) Show

Show returns the value of given key. This function is mapped to the path GET /info/{key}

type AuthResource

type AuthResource struct{}

AuthResource represents login, logout and signup

func (AuthResource) Login

func (a AuthResource) Login(c buffalo.Context) error

Login checks given credentials and generate jwt token This function is mapped to the path POST /login

func (AuthResource) Refresh

func (a AuthResource) Refresh(c buffalo.Context) error

Refresh refreshes given token with new expiration time. It updates user information from database.

func (AuthResource) Signup

func (a AuthResource) Signup(c buffalo.Context) error

Signup creates new user with given information and stores it in database. Signup do not create any token for new user. This function is mapped to the path POST /register

type ProjectsResource

type ProjectsResource struct {
	buffalo.Resource
}

ProjectsResource controls the users access to projects and proxies their request to pm

func (ProjectsResource) Create

func (v ProjectsResource) Create(c buffalo.Context) error

Create creates new project in pm and if it successful then adds newly created project to user projects This function is mapped to the path POST /projects

func (ProjectsResource) Destroy

func (v ProjectsResource) Destroy(c buffalo.Context) error

Destroy deletes given project from pm and if it successful then removes it from user projects This function is mapped to the path DELETE /projects/{proejct_id}

func (ProjectsResource) List

List lists user projects. It first gets projects list from pm then returns only the projects that are exist in user porject list. This function is mapped to the path GET /projects

func (ProjectsResource) Show

Show shows given project details that are fetched from pm. This function is mapped to the path GET /projects/{proejct_id}

type RefreshClaims

type RefreshClaims struct {
	ID  string
	Exp time.Time
}

RefreshClaims contains required information in I1820 platform to refresh a user access token.

func (RefreshClaims) Valid

func (rc RefreshClaims) Valid() error

Valid checks claims expiration time

type ThingsResource

type ThingsResource struct {
	buffalo.Resource
}

ThingsResource controls the users access to things and proxies their request to pm

func (ThingsResource) Assets

func (v ThingsResource) Assets(c buffalo.Context) error

Assets handles asset requests in pm. This function is mapped to the path ANY /projects/{project_id}/things/{thing_id}/assets/{path:.+}

func (ThingsResource) Connectivities

func (v ThingsResource) Connectivities(c buffalo.Context) error

Connectivities handles connectivity requests in pm. This function is mapped to the path ANY /projects/{project_id}/things/{thing_id}/connectivities/{path:.+}

func (ThingsResource) Create

func (v ThingsResource) Create(c buffalo.Context) error

Create creates a new thing in pm. This function is mapped to the path POST /projects/{project_id}/things

func (ThingsResource) Destroy

func (v ThingsResource) Destroy(c buffalo.Context) error

Destroy deletes given thing from pm. This function is mapped to the path DELETE /projects/{proejct_id}/things/{thing_id}

func (ThingsResource) List

func (v ThingsResource) List(c buffalo.Context) error

List lists things of given project. This function is mapped to the path GET /projects/{project_id}/things

func (ThingsResource) Show

func (v ThingsResource) Show(c buffalo.Context) error

Show shows given thing details that are fetched from pm. This function is mapped to the path GET /projects/{proejct_id}/things/{thing_id}

func (ThingsResource) Tokens

func (v ThingsResource) Tokens(c buffalo.Context) error

Tokens handles token requests in pm. This function is mapped to the path ANY /projects/{project_id}/things/{thing_id}/tokens/{path:.+}

type UserClaims

type UserClaims struct {
	U   models.User
	Exp time.Time
}

UserClaims contains required information in I1820 platform for logged in user.

func (UserClaims) Valid

func (uc UserClaims) Valid() error

Valid checks claims expiration time

type UsersResource

type UsersResource struct {
}

UsersResource handles operations on users. These operations only available to admins.

Jump to

Keyboard shortcuts

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