package
0.0.0-20170403140351-21d4febd4bca
Repository: https://github.com/sirbu/golang-common.git
Documentation: pkg.go.dev
# Functions
NewDatabaseError creates a new DatabaseError, wraps err and adds a message.
NewPaginator returns a pagination holder.
NewPaginatorFromRequest returns a paginator builded from an http request.
SortConverter convert a list of string to a SortParameters instance.
# Constants
Ascending sort from bottom to up.
DefaultPerPage defines the default value for pagination.
Descending sort from up to bottom.
# Variables
ErrNoResult is the error raised when the query result no results.
ErrNotImplemented is the error raised when the method is not implemented.
# Structs
DatabaseError is the wrapper for RethinkDB errors that allows passing more data with the message.
Pagination is a pagination calcul handler for database request.
# Interfaces
EntityCreator contains a function to create new instances in the table.
EntityCRUD is the interface that every table should implement.
EntityDeleter allows deleting resources from the database.
EntityReader allows fetching resources from the database.
EntityTable contains the most basic table functions.
EntityUpdater allows updating existing resources in the database.
# Type aliases
SortDirection is the enumeration for sort.
SortParameters contains a hashmap of field name with sort direction.