handlers

package
v0.0.0-...-a633465 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PhotoCreate

func PhotoCreate(ac echo.Context) error

PhotoCreate handle POST /api/v1.photo request response.Code: unsupportedPhotoFormat: bad photo format (jpeg or png) badData: bad data (not valid photo struct/object) badFile: bad file duplicate: duplicate

func PhotoDel

func PhotoDel(ac echo.Context) error

PhotoDel delete a photo

func PhotoGet

func PhotoGet(c echo.Context) error

PhotoGet return a photo

func PhotoGetProperties

func PhotoGetProperties(ac echo.Context) error

PhotoGetProperties returns PhotoProperties

func PhotoPut

func PhotoPut(ac echo.Context) error

PhotoPut alter photo properties

func PhotoResize

func PhotoResize(c echo.Context) error

PhotoResize returns resized photo

func PhotoSearch

func PhotoSearch(ac echo.Context) error

PhotoSearch return an array of photos regarding the optionnals search params (TMP)

func Todo

func Todo(c echo.Context) error

Todo for controllers to do

func UserCreate

func UserCreate(ac echo.Context) error

UserCreate create a new user

func UserGetPublicKey

func UserGetPublicKey(ac echo.Context) error

UserGetPublicKey return user public key

func UserLogin

func UserLogin(ac echo.Context) error

UserLogin used to login

func UserLogout

func UserLogout(ac echo.Context) error

UserLogout log out an user

func UserMe

func UserMe(ac echo.Context) error

UserMe return user (auth needed)

func UserNewFollower

func UserNewFollower(ac echo.Context) error

UserNewFollower follow request

func UserPasswordLost

func UserPasswordLost(ac echo.Context) error

UserPasswordLost utilities to recover password GET -> send an email with an auth link POST -> reset password

func UserProfile

func UserProfile(ac echo.Context) error

UserProfile dislay user profile Return - defaut -> html - if header Accept: application/activitypub or user.activitypub -> activitypub

func UserUsernameIsAvailable

func UserUsernameIsAvailable(ac echo.Context) error

UserUsernameIsAvailable checek if username if available

func WebfingerAcct

func WebfingerAcct(ac echo.Context) error

WebfingerAcct basic implementation

Types

type APIResponse

type APIResponse struct {
	UUID       string          `json:"uuid"`
	Timestamp  time.Time       `json:"timestamp"`
	HTTPStatus int             `json:"http_status"`
	Code       string          `json:"code"`
	Success    bool            `json:"success"`
	Message    string          `json:"message"` // message to user
	Log        string          `json:"-"`
	Data       json.RawMessage `json:"data,omitempty"`
	// contains filtered or unexported fields
}

APIResponse is the response returned by PeerPx API

func APIResponseFromBody

func APIResponseFromBody(body *bytes.Buffer) (APIResponse, error)

APIResponseFromBody unmarshall api response from http response body mainly used for tests

func NewAPIResponse

func NewAPIResponse(c *context.AppContext) *APIResponse

NewAPIResponse return an instantiated API response

func (*APIResponse) KO

func (r *APIResponse) KO(HTTPStatus int) error

KO send a not OK response (no error but success == false)

func (*APIResponse) OK

func (r *APIResponse) OK(HTTPStatus int) error

OK send an OK response

func (*APIResponse) Send

func (r *APIResponse) Send() error

Send send a reply

type PhotoSearchResponse

type PhotoSearchResponse struct {
	Total  int
	Limit  int
	Offset int
	Data   []photo.Photo
}

PhotoSearchResponse response structure for PhotoSearch

Jump to

Keyboard shortcuts

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