Documentation ¶
Index ¶
- func PrintRow(row bigtable.Row)
- type VaccineClient
- func (vaccineClient *VaccineClient) BatchCreateHospitals(IDs, counties, townships []string, attributes []map[string]string) error
- func (vaccineClient *VaccineClient) BatchCreateUsers(IDs []string, attributes []map[string]string) error
- func (vaccineClient *VaccineClient) CreateOrUpdateHospital(ID string, county string, township string, attributes map[string]string) error
- func (vaccineClient *VaccineClient) CreateOrUpdateReservation(ID string, userID string, attributes map[string]string) error
- func (vaccineClient *VaccineClient) CreateOrUpdateUser(ID string, attributes map[string]string) error
- func (vaccineClient *VaccineClient) DeleteHospital(ID string, county string, township string) error
- func (vaccineClient *VaccineClient) DeleteReservation(ID string, userID string) error
- func (vaccineClient *VaccineClient) DeleteUser(ID string) error
- func (vaccineClient *VaccineClient) GetHospital(ID string, county string, township string) (bigtable.Row, error)
- func (vaccineClient *VaccineClient) GetHospitals(county string, township string) ([]bigtable.Row, error)
- func (vaccineClient *VaccineClient) GetReservation(ID string, userID string) (bigtable.Row, error)
- func (vaccineClient *VaccineClient) GetReservations(userID string) ([]bigtable.Row, error)
- func (vaccineClient *VaccineClient) GetUser(ID string) (bigtable.Row, error)
- func (vaccineClient *VaccineClient) ListHospitals() ([]bigtable.Row, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type VaccineClient ¶
type VaccineClient struct {
// contains filtered or unexported fields
}
func NewVaccineClient ¶
func NewVaccineClient(projectID string, instanceID string, tableName string) *VaccineClient
func (*VaccineClient) BatchCreateHospitals ¶
func (vaccineClient *VaccineClient) BatchCreateHospitals(IDs, counties, townships []string, attributes []map[string]string) error
func (*VaccineClient) BatchCreateUsers ¶
func (vaccineClient *VaccineClient) BatchCreateUsers(IDs []string, attributes []map[string]string) error
func (*VaccineClient) CreateOrUpdateHospital ¶
func (*VaccineClient) CreateOrUpdateReservation ¶
func (*VaccineClient) CreateOrUpdateUser ¶
func (vaccineClient *VaccineClient) CreateOrUpdateUser(ID string, attributes map[string]string) error
Create or update a user, attributes map cannot be empty
Example Usage (Create):
err := vaccineClient.CreateOrUpdateUser("A123456789", map[string]string{ "name": "Alice", "healthCardID": "000011112222", "gender": "Female", "birthday": "2022/05/23", "address": "No.2, Sec. 4, Roosevelt Road, Taipei, 10617 Taiwan", "phone": "0912345678", "vaccines": "BNT,AZ", })
Example Usage (Update):
err := vaccineClient.CreateOrUpdateUser("A123456789", map[string]string{ "name": "Alice1", })
func (*VaccineClient) DeleteHospital ¶
func (vaccineClient *VaccineClient) DeleteHospital(ID string, county string, township string) error
func (*VaccineClient) DeleteReservation ¶
func (vaccineClient *VaccineClient) DeleteReservation(ID string, userID string) error
func (*VaccineClient) DeleteUser ¶
func (vaccineClient *VaccineClient) DeleteUser(ID string) error
Delete a user
Example Usage:
err := vaccineClient.DeleteUser("A123456789")
func (*VaccineClient) GetHospital ¶
func (*VaccineClient) GetHospitals ¶
func (*VaccineClient) GetReservation ¶
func (*VaccineClient) GetReservations ¶
func (vaccineClient *VaccineClient) GetReservations(userID string) ([]bigtable.Row, error)
func (*VaccineClient) GetUser ¶
func (vaccineClient *VaccineClient) GetUser(ID string) (bigtable.Row, error)
Get a user
Example Usage:
row, err := vaccineClient.GetUser("A123456789")
func (*VaccineClient) ListHospitals ¶
func (vaccineClient *VaccineClient) ListHospitals() ([]bigtable.Row, error)
Click to show internal directories.
Click to hide internal directories.