Documentation ¶
Index ¶
- func PhotoCreate(ac echo.Context) error
- func PhotoDel(ac echo.Context) error
- func PhotoGet(c echo.Context) error
- func PhotoGetProperties(ac echo.Context) error
- func PhotoPut(ac echo.Context) error
- func PhotoResize(c echo.Context) error
- func PhotoSearch(ac echo.Context) error
- func Todo(c echo.Context) error
- func UserCreate(ac echo.Context) error
- func UserGetPublicKey(ac echo.Context) error
- func UserLogin(ac echo.Context) error
- func UserLogout(ac echo.Context) error
- func UserMe(ac echo.Context) error
- func UserNewFollower(ac echo.Context) error
- func UserPasswordLost(ac echo.Context) error
- func UserProfile(ac echo.Context) error
- func UserUsernameIsAvailable(ac echo.Context) error
- func WebfingerAcct(ac echo.Context) error
- type APIResponse
- type PhotoSearchResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PhotoCreate ¶
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 PhotoGetProperties ¶
PhotoGetProperties returns PhotoProperties
func PhotoSearch ¶
PhotoSearch return an array of photos regarding the optionnals search params (TMP)
func UserGetPublicKey ¶
UserGetPublicKey return user public key
func UserPasswordLost ¶
UserPasswordLost utilities to recover password GET -> send an email with an auth link POST -> reset password
func UserProfile ¶
UserProfile dislay user profile Return - defaut -> html - if header Accept: application/activitypub or user.activitypub -> activitypub
func UserUsernameIsAvailable ¶
UserUsernameIsAvailable checek if username if available
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)