Documentation ¶
Index ¶
- Constants
- func GetVolunteerId(demonstrationId string, userId string) string
- func IsAdmin(dsc Client, phone string) (bool, error)
- func IsNoSuchEntityError(err error) bool
- type Client
- type ClientWrapper
- func (c *ClientWrapper) Delete(kind Kind, id string) error
- func (c *ClientWrapper) Get(kind Kind, id string, dst interface{}) error
- func (c *ClientWrapper) GetAll(kind Kind, dst interface{}) error
- func (c *ClientWrapper) GetFilter(kind Kind, filters []FilterField, dst interface{}) error
- func (c *ClientWrapper) Put(kind Kind, id string, src interface{}) error
- type Demonstration
- type FilterField
- type InMemoryClient
- func (c *InMemoryClient) Delete(kind Kind, id string) error
- func (c *InMemoryClient) Get(kind Kind, id string, dst interface{}) error
- func (c *InMemoryClient) GetAll(kind Kind, dst interface{}) error
- func (c *InMemoryClient) GetFilter(kind Kind, filters []FilterField, dst interface{}) error
- func (c *InMemoryClient) Put(kind Kind, id string, src interface{}) error
- func (c *InMemoryClient) SetGetFilterDelegate(delegate func(kind Kind, filters []FilterField, dst interface{}) error)
- type Kind
- type Observation
- type User
- type Volunteer
Constants ¶
View Source
const RoleAdmin = "admin"
Variables ¶
This section is empty.
Functions ¶
func GetVolunteerId ¶
func IsNoSuchEntityError ¶
Types ¶
type Client ¶
type Client interface { Get(kind Kind, id string, dst interface{}) error GetAll(kind Kind, dst interface{}) error GetFilter(kind Kind, filters []FilterField, dst interface{}) error Put(kind Kind, id string, src interface{}) error Delete(kind Kind, id string) error }
func NewClientWrapper ¶
func NewInMemoryClient ¶
func NewInMemoryClient() Client
type ClientWrapper ¶
type ClientWrapper struct {
// contains filtered or unexported fields
}
func (*ClientWrapper) Get ¶
func (c *ClientWrapper) Get(kind Kind, id string, dst interface{}) error
func (*ClientWrapper) GetAll ¶
func (c *ClientWrapper) GetAll(kind Kind, dst interface{}) error
func (*ClientWrapper) GetFilter ¶
func (c *ClientWrapper) GetFilter(kind Kind, filters []FilterField, dst interface{}) error
type Demonstration ¶
type Demonstration struct { Id string `json:"id" datastore:"id"` Name string `json:"name" datastore:"name"` }
func GetKaplanDemonstration ¶
func GetKaplanDemonstration(dsc Client) (*Demonstration, error)
type FilterField ¶
type InMemoryClient ¶
type InMemoryClient struct {
// contains filtered or unexported fields
}
func (*InMemoryClient) Get ¶
func (c *InMemoryClient) Get(kind Kind, id string, dst interface{}) error
func (*InMemoryClient) GetAll ¶
func (c *InMemoryClient) GetAll(kind Kind, dst interface{}) error
func (*InMemoryClient) GetFilter ¶
func (c *InMemoryClient) GetFilter(kind Kind, filters []FilterField, dst interface{}) error
func (*InMemoryClient) Put ¶
func (c *InMemoryClient) Put(kind Kind, id string, src interface{}) error
func (*InMemoryClient) SetGetFilterDelegate ¶
func (c *InMemoryClient) SetGetFilterDelegate(delegate func(kind Kind, filters []FilterField, dst interface{}) error)
type Observation ¶
type Observation struct { Time int64 `json:"time" datastore:"time"` User string `json:"user_id" datastore:"user_id"` Demonstration string `json:"demonstration" datastore:"demonstration"` Polygon string `json:"polygon" datastore:"polygon"` Density float32 `json:"density" datastore:"density"` Latitude float32 `json:"latitude" datastore:"latitude"` Longitude float32 `json:"longitude" datastore:"longitude"` }
func GetObservations ¶
func GetObservations(dsc Client, demonstration string) ([]Observation, error)
type User ¶
type Volunteer ¶
type Volunteer struct { UserId string `json:"user_id" datastore:"user_id"` DemonstrationId string `json:"demonstration_id" datastore:"demonstration_id"` Polygon string `json:"polygon" datastore:"polygon"` Location string `json:"location" datastore:"location"` Time int64 `json:"time" datastore:"time"` }
Click to show internal directories.
Click to hide internal directories.