controllers

package
v0.0.0-...-f464bf3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCommentContentIsNotValid = errors.New("Comment is too long")
View Source
var ErrCommentContentIsZero = errors.New("Comment content is empty")
View Source
var ErrLoginNameIsNotValid = errors.New("Name should be at least 3 characters long")
View Source
var ErrLoginNameIsZero = errors.New("Login name is zero value")
View Source
var ErrSeMyUserNameOpIsNotValid = errors.New("Op value is not valid")
View Source
var ErrSeMyUserNameOpIsZero = errors.New("Op is zero value")
View Source
var ErrSeMyUserNamePathIsNotValid = errors.New("Path value is not valid")
View Source
var ErrSeMyUserNamePathIsZero = errors.New("Path is zero value")
View Source
var ErrSetMyUserNameValueIsNotValid = errors.New("Value should be at least 3 characters long")
View Source
var ErrSetMyUserNameValueIsZero = errors.New("Value name is zero value")
View Source
var (
	// ErrTypeAssertionError is thrown when type an interface does not match the asserted type
	ErrTypeAssertionError = errors.New("unable to assert type")
)

Functions

This section is empty.

Types

type CommentPhoto

type CommentPhoto struct {
	// User name
	Content string `json:"content,omitempty"`
}

CommentPhoto - Comment a photo

type Controller

type Controller interface {
	Routes() routes.Routes
}

Router defines the required methods for retrieving api routes

func NewBansController

func NewBansController(s services.BansService) Controller

NewBansController creates a default api controller

func NewCommentsController

func NewCommentsController(s services.CommentsService) Controller

Newc creates a default api controller

func NewFollowsController

func NewFollowsController(s services.FollowsService) Controller

NewFollowsController creates a default api controller

func NewLikesController

func NewLikesController(s services.LikesService) Controller

NewLikesController creates a default api controller

func NewLoginController

func NewLoginController(s services.AuthService) Controller

NewLoginController creates a default api controller

func NewPhotosController

func NewPhotosController(s services.PhotosService) Controller

NewPhotosController creates a default api controller

func NewUsersController

func NewUsersController(s services.UsersService) Controller

NewUsersController creates a default api controller

type DoLoginRequest

type DoLoginRequest struct {

	// User name
	Name string `json:"name,omitempty"`
}

DoLoginRequest - Name of the user

type DoLoginResponse

type DoLoginResponse struct {

	// Token identifier for a logged in user
	Identifier string `json:"identifier,omitempty"`
}

DoLoginResponse - Token identifier for a logged in user

type ErrorHandler

type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, ctx reqcontext.RequestContext)

ErrorHandler defines the required method for handling error.

type ForbiddenError

type ForbiddenError struct {
	Err error
}

Forbidden indicates that an error has occurred when trying to access a forbidden resource

func (*ForbiddenError) Error

func (e *ForbiddenError) Error() string

func (*ForbiddenError) Unwrap

func (e *ForbiddenError) Unwrap() error

type NotFoundError

type NotFoundError struct {
	Entity string
}

NotFoundError indicates that an error has occurred when trying to access a not existing entity

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type ParsingError

type ParsingError struct {
	Err error
}

ParsingError indicates that an error has occurred when parsing request parameters

func (*ParsingError) Error

func (e *ParsingError) Error() string

func (*ParsingError) Unwrap

func (e *ParsingError) Unwrap() error

type RequiredError

type RequiredError struct {
	Field string
}

RequiredError indicates that an error has occurred when parsing required request parameters

func (*RequiredError) Error

func (e *RequiredError) Error() string

type SetMyUserNameRequest

type SetMyUserNameRequest struct {
	// Patch operation type
	Op string `json:"op,omitempty"`

	// Field to patch
	Path string `json:"path,omitempty"`

	// New field valued
	Value string `json:"value,omitempty"`
}

Jump to

Keyboard shortcuts

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