common_service

package
v0.0.0-...-4e1abb7 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PaginationSelectFormat = "%s, COUNT(*) OVER() AS total"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonService

type CommonService struct {
	// contains filtered or unexported fields
}

func (CommonService) BuildPaginatedSorted

func (s CommonService) BuildPaginatedSorted(page, perPage int, sort *string, unscoped bool) *gorm.DB

BuildPaginatedSorted returns prepared request with pagination and sorting, also unscoped feature supported

func (CommonService) Db

func (s CommonService) Db() *gorm.DB

Db returns connection

type ICommonService

type ICommonService interface {
	Db() *gorm.DB
	BuildPaginatedSorted(page, perPage int, sort *string, unscoped bool) *gorm.DB
}

ICommonService represents public interface for services

func New

func New(db db.IDb) ICommonService

New instantiates common service

Jump to

Keyboard shortcuts

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