Documentation ¶
Index ¶
- Constants
- func Migrate(ctx context.Context, conn gocqlx.Session) error
- func SendWebpush(ctx context.Context, keypair KeyPair, wws WebpushSubscription, payload []byte) error
- type Alert
- type KeyPair
- type SensorInfoWithLastReading
- type Store
- func (s *Store) AlertsSubscriber(ctx context.Context, data redis.AlertEvent)
- func (s *Store) Close()
- func (s *Store) CreateUser(ctx context.Context, user User) error
- func (s *Store) DeleteUser(ctx context.Context, id ulid.ULID) error
- func (s *Store) GetAlerts(ctx context.Context) ([]Alert, error)
- func (s *Store) GetAllWebpushSubs(ctx context.Context) ([]WebpushSubscription, error)
- func (s *Store) GetMigrations(ctx context.Context) ([]models.MigrationsStruct, error)
- func (s *Store) GetSensor(ctx context.Context, id string) (SensorInfoWithLastReading, error)
- func (s *Store) GetSensors(ctx context.Context) ([]SensorInfoWithLastReading, error)
- func (s *Store) GetUser(ctx context.Context, id ulid.ULID) (User, error)
- func (s *Store) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (s *Store) GetUsers(ctx context.Context) ([]User, error)
- func (s *Store) GetWebpushKey(ctx context.Context) (KeyPair, error)
- func (s *Store) GetWebpushSubscriptions(ctx context.Context, userID ulid.ULID) (UserWebpushSubscriptions, error)
- func (s *Store) MediaPublisherSubscriber(ctx context.Context, data redis.MediaPublisher)
- func (s *Store) ReadingsSubscriber(ctx context.Context, data redis.SensorReading)
- func (s *Store) RegisterWebpush(ctx context.Context, userID ulid.ULID, endpoint, auth, p256dh string) error
- func (s *Store) RenameSensor(ctx context.Context, id string, name string) error
- func (s *Store) RotateWebpushKey(ctx context.Context) (KeyPair, error)
- func (s *Store) UpdateUser(ctx context.Context, user User) error
- type User
- type UserWebpushSubscriptions
- type WebpushSubscription
Constants ¶
View Source
const ReadingTTL = time.Hour * 24 * 30 * 12 // 1 year~
Variables ¶
This section is empty.
Functions ¶
func SendWebpush ¶
Types ¶
type SensorInfoWithLastReading ¶
type SensorInfoWithLastReading struct { IoTID string Name string URL string Readings []redis.SensorReading // readings for each kind }
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AlertsSubscriber ¶
func (s *Store) AlertsSubscriber(ctx context.Context, data redis.AlertEvent)
func (*Store) GetAllWebpushSubs ¶
func (s *Store) GetAllWebpushSubs(ctx context.Context) ([]WebpushSubscription, error)
func (*Store) GetMigrations ¶
func (*Store) GetSensors ¶
func (s *Store) GetSensors(ctx context.Context) ([]SensorInfoWithLastReading, error)
func (*Store) GetUserByEmail ¶
func (*Store) GetWebpushSubscriptions ¶
func (*Store) MediaPublisherSubscriber ¶
func (s *Store) MediaPublisherSubscriber(ctx context.Context, data redis.MediaPublisher)
func (*Store) ReadingsSubscriber ¶
func (s *Store) ReadingsSubscriber(ctx context.Context, data redis.SensorReading)
func (*Store) RegisterWebpush ¶
func (*Store) RenameSensor ¶
func (*Store) RotateWebpushKey ¶
type UserWebpushSubscriptions ¶
type UserWebpushSubscriptions struct { UserID ulid.ULID `db:"user_id"` Subs []WebpushSubscription `db:"subscription"` }
type WebpushSubscription ¶
Click to show internal directories.
Click to hide internal directories.