storage

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2018 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 Base added in v0.8.0

type Base interface {
	SetCurrentTenant(*models.Tenant)
	SetCurrentUser(*models.User)
}

Base is a generic storage base interface

type Idea

type Idea interface {
	Base
	GetByID(ideaID int) (*models.Idea, error)
	GetBySlug(slug string) (*models.Idea, error)
	GetByNumber(number int) (*models.Idea, error)
	GetCommentsByIdea(idea *models.Idea) ([]*models.Comment, error)
	Search(query, filter string, tags []string) ([]*models.Idea, error)
	GetAll() ([]*models.Idea, error)
	CountPerStatus() (map[int]int, error)
	Add(title, description string) (*models.Idea, error)
	Update(idea *models.Idea, title, description string) (*models.Idea, error)
	AddComment(idea *models.Idea, content string) (int, error)
	GetCommentByID(id int) (*models.Comment, error)
	UpdateComment(id int, content string) error
	AddSupporter(idea *models.Idea, user *models.User) error
	RemoveSupporter(idea *models.Idea, user *models.User) error
	AddSubscriber(idea *models.Idea, user *models.User) error
	RemoveSubscriber(idea *models.Idea, user *models.User) error
	GetActiveSubscribers(number int, channel models.NotificationChannel, event models.NotificationEvent) ([]*models.User, error)
	SetResponse(idea *models.Idea, text string, status int) error
	MarkAsDuplicate(idea *models.Idea, original *models.Idea) error
	IsReferenced(idea *models.Idea) (bool, error)
	SupportedBy() ([]int, error)
}

Idea contains read and write operations for ideas

type Notification added in v0.10.0

type Notification interface {
	Base
	Insert(user *models.User, title, link string, ideaID int) (*models.Notification, error)
	MarkAsRead(id int) error
	MarkAllAsRead() error
	TotalUnread() (int, error)
	GetActiveNotifications() ([]*models.Notification, error)
	GetNotification(id int) (*models.Notification, error)
}

Notification contains read and write operations for notifications

type Tag added in v0.8.0

type Tag interface {
	Base
	Add(name, color string, isPublic bool) (*models.Tag, error)
	GetBySlug(slug string) (*models.Tag, error)
	Update(tag *models.Tag, name, color string, isPublic bool) (*models.Tag, error)
	Delete(tag *models.Tag) error
	GetAssigned(idea *models.Idea) ([]*models.Tag, error)
	AssignTag(tag *models.Tag, idea *models.Idea) error
	UnassignTag(tag *models.Tag, idea *models.Idea) error
	GetAll() ([]*models.Tag, error)
}

Tag contains read and write operations for tags

type Tenant

type Tenant interface {
	Base
	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)
	IsCNAMEAvailable(cname string) (bool, error)
	SaveVerificationKey(key string, duration time.Duration, request models.NewEmailVerification) error
	FindVerificationByKey(kind models.EmailVerificationKind, key string) (*models.EmailVerification, error)
	SetKeyAsVerified(key string) error
}

Tenant contains read and write operations for tenants

type User

type User interface {
	Base
	GetByID(userID int) (*models.User, error)
	GetByEmail(email string) (*models.User, error)
	GetByProvider(provider string, uid string) (*models.User, error)
	Register(user *models.User) error
	RegisterProvider(userID int, provider *models.UserProvider) error
	Update(settings *models.UpdateUserSettings) error
	ChangeEmail(userID int, email string) error
	ChangeRole(userID int, role models.Role) error
	GetAll() ([]*models.User, error)
	GetUserSettings() (map[string]string, error)
	UpdateSettings(settings map[string]string) error
	HasSubscribedTo(ideaID int) (bool, 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