Documentation ¶
Index ¶
- type ChatState
- type ChatStateUpdate
- type ObserveArea
- type Path
- type Point
- type PointAsArray
- type Storage
- func (s *Storage) CreateSubscription(chatID int64, name string) (*entity.Subscription, error)
- func (s *Storage) DeleteSubscription(subHexID string) error
- func (s *Storage) GetChatState(chatID int64) *entity.ChatState
- func (s *Storage) GetEventSubscribers(eventData entity.EventData) (chatIDs []int64, err error)
- func (s *Storage) GetSubscription(subHexID string) (*entity.Subscription, error)
- func (s *Storage) GetSubscriptions(chatID int64) (subs []entity.Subscription)
- func (s *Storage) SetChatState(chatID int64, update *entity.ChatStateUpdate) (*entity.ChatState, error)
- func (s *Storage) UpdateSubscription(subHexID string, subUpdate *entity.SubscriptionUpdate) (*entity.Subscription, error)
- type Subscription
- type SubscriptionChatID
- type SubscriptionUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatStateUpdate ¶
type ObserveArea ¶
ObserveArea is a GeoJSON type.
func NewObserveArea ¶
func NewObserveArea(path Path) *ObserveArea
NewObserveArea creates a GeoJSON type Polygon with a single path (called exterior ring).
type Path ¶
type Path []PointAsArray
type Point ¶
Point represents a GeoJSON type
func (Point) ToArray ¶
func (p Point) ToArray() (arr PointAsArray)
type PointAsArray ¶
type PointAsArray [2]float64
PointAsArray represents a GeoJSON Point in array format. First element is longitude, second is latitude.
type Storage ¶
func NewStorage ¶
func (*Storage) CreateSubscription ¶
func (*Storage) DeleteSubscription ¶
func (*Storage) GetEventSubscribers ¶
func (*Storage) GetSubscription ¶
func (s *Storage) GetSubscription(subHexID string) (*entity.Subscription, error)
func (*Storage) GetSubscriptions ¶
func (s *Storage) GetSubscriptions(chatID int64) (subs []entity.Subscription)
func (*Storage) SetChatState ¶
func (*Storage) UpdateSubscription ¶
func (s *Storage) UpdateSubscription( subHexID string, subUpdate *entity.SubscriptionUpdate, ) (*entity.Subscription, error)
type Subscription ¶
type Subscription struct { ID primitive.ObjectID `bson:"_id,omitempty"` Name string `bson:"name,omitempty"` ChatID int64 `bson:"chat_id,omitempty"` MinMag float64 `bson:"min_mag,omitempty"` Delay float64 `bson:"delay,omitempty"` Location *Point `bson:"location,omitempty"` Radius float64 `bson:"radius,omitempty"` ObserveArea *ObserveArea `bson:"observe_area,omitempty"` Sources []string `bson:"sources,omitempty"` }
type SubscriptionChatID ¶
type SubscriptionChatID struct {
ChatID int64 `bson:"chat_id,omitempty"`
}
type SubscriptionUpdate ¶
type SubscriptionUpdate struct { Name string `bson:"name,omitempty"` MinMag float64 `bson:"min_mag,omitempty"` Delay float64 `bson:"delay,omitempty"` Location *Point `bson:"location,omitempty"` Radius float64 `bson:"radius"` ObserveArea *ObserveArea `bson:"observe_area,omitempty"` Sources []string `bson:"sources,omitempty"` }
Click to show internal directories.
Click to hide internal directories.