Documentation ¶
Index ¶
- type IdeaStorage
- func (s *IdeaStorage) Add(title, description string, userID int) (*models.Idea, error)
- func (s *IdeaStorage) AddComment(number int, content string, userID int) (int, error)
- func (s *IdeaStorage) AddSupporter(number, userID int) error
- func (s *IdeaStorage) GetAll() ([]*models.Idea, error)
- func (s *IdeaStorage) GetByID(ideaID int) (*models.Idea, error)
- func (s *IdeaStorage) GetByNumber(number int) (*models.Idea, error)
- func (s *IdeaStorage) GetCommentsByIdea(number int) ([]*models.Comment, error)
- func (s *IdeaStorage) RemoveSupporter(number, userID int) error
- func (s *IdeaStorage) SetResponse(number int, text string, userID, status int) error
- func (s *IdeaStorage) SupportedBy(userID int) ([]int, error)
- func (s *IdeaStorage) Update(number int, title, description string) (*models.Idea, error)
- type TenantStorage
- func (s *TenantStorage) Add(name string, subdomain string) (*models.Tenant, error)
- func (s *TenantStorage) First() (*models.Tenant, error)
- func (s *TenantStorage) GetByDomain(domain string) (*models.Tenant, error)
- func (s *TenantStorage) IsSubdomainAvailable(subdomain string) (bool, error)
- func (s *TenantStorage) UpdateSettings(tenantID int, title, invitation, welcomeMessage string) error
- type UserStorage
- func (s *UserStorage) GetByEmail(tenantID int, email string) (*models.User, error)
- func (s *UserStorage) GetByID(userID int) (*models.User, error)
- func (s *UserStorage) GetByProvider(tenantID int, provider string, uid string) (*models.User, error)
- func (s *UserStorage) Register(user *models.User) error
- func (s *UserStorage) RegisterProvider(userID int, provider *models.UserProvider) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdeaStorage ¶
type IdeaStorage struct {
// contains filtered or unexported fields
}
IdeaStorage contains read and write operations for ideas
func (*IdeaStorage) AddComment ¶
AddComment places a new comment on an idea
func (*IdeaStorage) AddSupporter ¶
func (s *IdeaStorage) AddSupporter(number, userID int) error
AddSupporter adds user to idea list of supporters
func (*IdeaStorage) GetAll ¶
func (s *IdeaStorage) GetAll() ([]*models.Idea, error)
GetAll returns all tenant ideas
func (*IdeaStorage) GetByID ¶
func (s *IdeaStorage) GetByID(ideaID int) (*models.Idea, error)
GetByID returns idea by given id
func (*IdeaStorage) GetByNumber ¶
func (s *IdeaStorage) GetByNumber(number int) (*models.Idea, error)
GetByNumber returns idea by tenant and number
func (*IdeaStorage) GetCommentsByIdea ¶
func (s *IdeaStorage) GetCommentsByIdea(number int) ([]*models.Comment, error)
GetCommentsByIdea returns all coments from given idea
func (*IdeaStorage) RemoveSupporter ¶
func (s *IdeaStorage) RemoveSupporter(number, userID int) error
RemoveSupporter removes user from idea list of supporters
func (*IdeaStorage) SetResponse ¶
func (s *IdeaStorage) SetResponse(number int, text string, userID, status int) error
SetResponse changes current idea response
func (*IdeaStorage) SupportedBy ¶
func (s *IdeaStorage) SupportedBy(userID int) ([]int, error)
SupportedBy returns a list of Idea ID supported by given user
type TenantStorage ¶
type TenantStorage struct {
// contains filtered or unexported fields
}
TenantStorage contains read and write operations for tenants
func (*TenantStorage) First ¶
func (s *TenantStorage) First() (*models.Tenant, error)
First returns first tenant
func (*TenantStorage) GetByDomain ¶
func (s *TenantStorage) GetByDomain(domain string) (*models.Tenant, error)
GetByDomain returns a tenant based on its domain
func (*TenantStorage) IsSubdomainAvailable ¶
func (s *TenantStorage) IsSubdomainAvailable(subdomain string) (bool, error)
IsSubdomainAvailable returns true if subdomain is available to use
func (*TenantStorage) UpdateSettings ¶ added in v0.4.0
func (s *TenantStorage) UpdateSettings(tenantID int, title, invitation, welcomeMessage string) error
UpdateSettings of given tenant
type UserStorage ¶
type UserStorage struct {
// contains filtered or unexported fields
}
UserStorage is used for user operations
func (*UserStorage) GetByEmail ¶
GetByEmail returns a user based on given email
func (*UserStorage) GetByID ¶
func (s *UserStorage) GetByID(userID int) (*models.User, error)
GetByID returns a user based on given id
func (*UserStorage) GetByProvider ¶ added in v0.4.0
func (s *UserStorage) GetByProvider(tenantID int, provider string, uid string) (*models.User, error)
GetByProvider returns a user based on provider details
func (*UserStorage) Register ¶
func (s *UserStorage) Register(user *models.User) error
Register creates a new user based on given information
func (*UserStorage) RegisterProvider ¶
func (s *UserStorage) RegisterProvider(userID int, provider *models.UserProvider) error
RegisterProvider adds given provider to userID