api

package
v0.0.0-...-835c9c4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logout

func Logout(c buffalo.Context) error

Logout ends the session of the user or scoped admin

swagger:route DELETE /api/v1/logout user logout Log out of the user account. responses:

  200: tokenResponse
	 400: errorResponse
	 401: errorResponse
	 403: errorResponse
	 422: errorResponse
	 500: errorResponse

func Profile

func Profile(c buffalo.Context) error

Profile returns the current user's profile

swagger:route GET /api/v1/profile user profile Returns the users profile. responses:

  200: profileResponse
	 400: errorResponse
	 401: errorResponse
	 403: errorResponse
	 422: errorResponse
	 500: errorResponse

func Register

func Register(app *buffalo.App)

Register registers the api endpoints with the app

Types

type ErrorPayload

type ErrorPayload struct {
	Error string `json:"error"`
}

ErrorPayload wraps errors in a well-defined api payload

type ErrorResponse

type ErrorResponse struct {
	//in:body
	Body ErrorPayload
}

ErrorResponse returns an api error swagger:response apiErrorResponse

type ProfileResponse

type ProfileResponse struct {
	//in:body
	Body ProfileResponsePayload
}

ProfileResponse returns the user profile information swagger:response profileResponse

type ProfileResponsePayload

type ProfileResponsePayload struct {
	User *modelext.UserWithGroup `json:"user"`
}

ProfileResponsePayload contains user profile information

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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