Documentation
¶
Index ¶
- type AdminWebcam
- type List
- type ListRepo
- type Quote
- type QuotePage
- type QuoteRepo
- type Repos
- type Store
- func (m *Store) DeleteQuote(ctx context.Context, quoteID int) error
- func (m *Store) GetList(ctx context.Context, listID int) (List, error)
- func (m *Store) GetLists(ctx context.Context) ([]List, error)
- func (m *Store) GetListsByUserID(ctx context.Context, userID int) ([]List, error)
- func (m *Store) GetSubscribers(ctx context.Context, listID int) ([]Subscriber, error)
- func (m *Store) GetWebcam(ctx context.Context, cameraID int, permissions []string) (Webcam, error)
- func (m *Store) ListQuotes(ctx context.Context, amount, page int) (QuotePage, error)
- func (m *Store) ListWebcams(ctx context.Context, permissions []string) ([]Webcam, error)
- func (m *Store) NewQuote(ctx context.Context, q Quote) error
- func (m *Store) Subscribe(ctx context.Context, userID, listID int) error
- func (m *Store) UnsubscribeByID(ctx context.Context, userID, listID int) error
- func (m *Store) UnsubscribeByUUID(ctx context.Context, uuid string) error
- func (m *Store) UpdateQuote(ctx context.Context, q Quote) error
- type Subscriber
- type Webcam
- type WebcamRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminWebcam ¶
type AdminWebcam struct {
Webcam
Enabled bool `db:"enabled" json:"enabled"`
Permission string `db:"permission_id" json:"permissionID"`
}
AdminWebcam represents extra options to configure the webcam
type List ¶ added in v0.7.0
type List struct {
ListID int `db:"list_id" json:"listID"`
Name string `db:"name" json:"name"`
Description string `db:"description" json:"description"`
Alias string `db:"alias" json:"alias"`
PermissionID *int `db:"permission_id" json:"permissionID"`
IsSubscribed bool `db:"is_subscribed" json:"isSubscribed"`
Subscribers []Subscriber `json:"subscribers,omitempty"`
}
List is a mailing list which people can subscribe to
type ListRepo ¶ added in v0.7.0
type ListRepo interface {
GetLists(ctx context.Context) ([]List, error)
GetListsByUserID(ctx context.Context, userID int) ([]List, error)
GetList(ctx context.Context, listID int) (List, error)
GetSubscribers(ctx context.Context, listID int) ([]Subscriber, error)
Subscribe(ctx context.Context, userID, listID int) error
UnsubscribeByID(ctx context.Context, userID, listID int) error
UnsubscribeByUUID(ctx context.Context, uuid string) error
}
ListRepo represents all mailing list interactions
Send emails to roles and other groups
type Quote ¶
type Quote struct {
QuoteID int `db:"quote_id" json:"id"`
Quote string `db:"quote" json:"quote"`
Description string `db:"description" json:"description"`
CreatedBy int `db:"created_by" json:"createdBy"`
}
Quote is an individual quote
type QuoteRepo ¶
type QuoteRepo interface {
ListQuotes(ctx context.Context, amount, page int) (QuotePage, error)
NewQuote(ctx context.Context, q Quote) error
UpdateQuote(ctx context.Context, q Quote) error
DeleteQuote(ctx context.Context, quoteID int) error
}
QuoteRepo defines all quote interactions
type Repos ¶ added in v0.9.6
type Repos interface {
QuoteRepo
WebcamRepo
ListRepo
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store contains our dependency
func (*Store) DeleteQuote ¶
DeleteQuote deletes a quote
func (*Store) GetLists ¶ added in v0.7.0
GetLists returns all available mailing lists Doesn't include individual subscribers
func (*Store) GetListsByUserID ¶ added in v0.7.0
GetListsByUserID returns all available and currently subscribed to mailing lists for a user don't include individual subscribers
func (*Store) GetSubscribers ¶ added in v0.7.0
GetSubscribers returns all subscribers of a list
func (*Store) ListQuotes ¶
ListQuotes returns a section of quotes
func (*Store) ListWebcams ¶
ListWebcams returns all webcams a user can access
func (*Store) UnsubscribeByID ¶ added in v0.7.0
UnsubscribeByID removes a user from a mailing list by userID and listID
func (*Store) UnsubscribeByUUID ¶ added in v0.7.0
UnsubscribeByUUID removes a user from a mailing list by the subscriber UUID
type Subscriber ¶ added in v0.7.0
type Subscriber struct {
SubscribeID string `db:"subscribe_id" json:"subscribeID"`
people.User `json:"user"`
}
Subscriber is an individual user on a mailing list