storage

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Idea

type Idea interface {
	GetByID(ideaID int) (*models.Idea, error)
	GetByNumber(number int) (*models.Idea, error)
	GetCommentsByIdea(number int) ([]*models.Comment, error)
	GetAll() ([]*models.Idea, error)
	Add(title, description string, userID int) (*models.Idea, error)
	Update(number int, title, description string) (*models.Idea, error)
	AddComment(number int, content string, userID int) (int, error)
	AddSupporter(number, userID int) error
	RemoveSupporter(number, userID int) error
	SetResponse(number int, text string, userID, status int) error
	SupportedBy(userID int) ([]int, error)
}

Idea contains read and write operations for ideas

type Tenant

type Tenant interface {
	Add(name string, subdomain string, status int) (*models.Tenant, error)
	First() (*models.Tenant, error)
	Activate(id int) error
	GetByDomain(domain string) (*models.Tenant, error)
	UpdateSettings(settings *models.UpdateTenantSettings) error
	IsSubdomainAvailable(subdomain string) (bool, error)
	SaveVerificationKey(key string, duration time.Duration, email, name string) error
	FindVerificationByKey(key string) (*models.SignInRequest, error)
	SetKeyAsVerified(key string) error
	SetCurrentTenant(*models.Tenant)
}

Tenant contains read and write operations for tenants

type User

type User interface {
	GetByID(userID int) (*models.User, error)
	GetByEmail(tenantID int, email string) (*models.User, error)
	GetByProvider(tenantID int, provider string, uid string) (*models.User, error)
	Register(user *models.User) error
	RegisterProvider(userID int, provider *models.UserProvider) error
	Update(userID int, settings *models.UpdateUserSettings) error
}

User is used for user operations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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