repositories

package
v0.0.0-...-930ef9c Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRepository

type AuthRepository struct {
	Repository
}

func MakeAuthRepository

func MakeAuthRepository(db *sql.DB) AuthRepository

func (AuthRepository) CheckSession

func (a AuthRepository) CheckSession(sessionId string, login string, token *models.Token) bool

func (AuthRepository) CreateSession

func (a AuthRepository) CreateSession(email string) *models.Session

func (AuthRepository) GetFacebookUrl

func (a AuthRepository) GetFacebookUrl() (string, error)

func (AuthRepository) GetToken

func (a AuthRepository) GetToken(sessionId string) (*models.Token, error)

func (AuthRepository) ProcessFacebookCallback

func (a AuthRepository) ProcessFacebookCallback(rawurl string) (*common.Credentials, error)

func (AuthRepository) SaveSession

func (a AuthRepository) SaveSession(session *models.Session) error

type CategoryCheckResult

type CategoryCheckResult struct {
	Existing   bool
	Categories []*models.Category
	Entries    []*models.Entry
}

type CategoryRepository

type CategoryRepository struct {
	Validator CategoryValidator
	Repository
}

func MakeCategoryRepository

func MakeCategoryRepository(validator CategoryValidator, db *sql.DB) CategoryRepository

func (CategoryRepository) CheckForUsedCategory

func (r CategoryRepository) CheckForUsedCategory(id int) (CategoryCheckResult, error)

func (CategoryRepository) Create

func (r CategoryRepository) Create(e *models.Category) (int, error)

func (CategoryRepository) Delete

func (CategoryRepository) GetById

func (r CategoryRepository) GetById(id int) (*models.Category, error)

func (CategoryRepository) GetByParentId

func (r CategoryRepository) GetByParentId(catid int) ([]*models.Category, error)

get categories by parentID

func (CategoryRepository) GetCategoriesByIdList

func (r CategoryRepository) GetCategoriesByIdList(ids []int64) ([]models.Category, error)

func (CategoryRepository) GetEntriesByCategoryId

func (CategoryRepository) GetEntriesByCategoryId(catid int) ([]*models.Entry, error)

get entries from some category

func (CategoryRepository) List

func (r CategoryRepository) List() ([]*models.Category, error)

func (CategoryRepository) Update

func (r CategoryRepository) Update(e *models.Category) error

func (CategoryRepository) ValidateCategory

func (r CategoryRepository) ValidateCategory(category *models.Category) (bool, error)

Verifica se a categoria é valida ou não.

type CategoryValidator

type CategoryValidator interface {
	GetById(int) (*models.Category, error)
	ValidateCategory(*models.Category) (bool, error)
	CheckForUsedCategory(int) (CategoryCheckResult, error)
	GetByParentId(int) ([]*models.Category, error)
	GetEntriesByCategoryId(int) ([]*models.Entry, error)
}

type EntryRepository

type EntryRepository struct {
	Validator EntryValidator
	Repository
}

func MakeEntryRepository

func MakeEntryRepository(v EntryValidator) EntryRepository

func (EntryRepository) Create

func (r EntryRepository) Create(e *models.Entry) (int, error)

func (EntryRepository) Delete

func (r EntryRepository) Delete(id int) error

func (EntryRepository) GetById

func (r EntryRepository) GetById(id int) (*models.Entry, error)

func (EntryRepository) GetByMedlineId

func (r EntryRepository) GetByMedlineId(id string) (*models.Entry, error)

func (EntryRepository) GetEntryCategories

func (r EntryRepository) GetEntryCategories(id int) ([]int64, error)

func (EntryRepository) GetEntryTypeById

func (r EntryRepository) GetEntryTypeById(id int) (*models.EntryType, error)

func (EntryRepository) InsertEntryCategory

func (r EntryRepository) InsertEntryCategory(entryId int, categoryId int) error

func (EntryRepository) List

func (r EntryRepository) List(start int, stop int) (*[]models.Entry, error)

func (EntryRepository) Update

func (r EntryRepository) Update(e *models.Entry) error

func (EntryRepository) ValidateEntry

func (r EntryRepository) ValidateEntry(e *models.Entry) error

type EntryTypeRepository

type EntryTypeRepository struct {
	Repository
}

func MakeEntryTypeRepository

func MakeEntryTypeRepository(db *sql.DB) EntryTypeRepository

func (EntryTypeRepository) Create

func (r EntryTypeRepository) Create(e *models.EntryType) (int, error)

func (EntryTypeRepository) Delete

func (r EntryTypeRepository) Delete(id int) error

func (EntryTypeRepository) GetById

func (r EntryTypeRepository) GetById(id int) (*models.EntryType, error)

func (EntryTypeRepository) List

func (r EntryTypeRepository) List() ([]*models.EntryType, error)

func (EntryTypeRepository) Update

type EntryValidator

type EntryValidator interface {
	ValidateEntry(*models.Entry) error
}

type Repository

type Repository struct {
	DB *sql.DB
}

type SearchRepository

type SearchRepository struct {
	Repository
}

func MakeSearchRepository

func MakeSearchRepository() SearchRepository

func (SearchRepository) ExecuteSearch

func (s SearchRepository) ExecuteSearch(query *models.SearchQuery) ([]models.Entry, int, error)

func (SearchRepository) ProcessFacets

func (s SearchRepository) ProcessFacets(results *models.SearchResults) (*models.SearchResults, error)

func (SearchRepository) ProcessInput

func (s SearchRepository) ProcessInput(query *models.SearchQuery) (*models.SearchQuery, error)

func (SearchRepository) ProcessResultsNavigation

func (s SearchRepository) ProcessResultsNavigation(query *models.SearchQuery, results []models.Entry, total int) (*models.SearchResults, error)

func (SearchRepository) Search

type UserRepository

type UserRepository struct {
	Repository
}

func (UserRepository) GetById

func (r UserRepository) GetById(id string) (*models.User, error)

Jump to

Keyboard shortcuts

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