vaccineclient

package
v0.0.0-...-76fc54f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintRow

func PrintRow(row bigtable.Row)

Utility function to print out a row

Example Usage:

vaccineclient.PrintRow(row)

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 *VaccineClient) CreateOrUpdateHospital(ID string, county string, township string, attributes map[string]string) error

func (*VaccineClient) CreateOrUpdateReservation

func (vaccineClient *VaccineClient) CreateOrUpdateReservation(ID string, userID string, attributes map[string]string) error

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 *VaccineClient) GetHospital(ID string, county string, township string) (bigtable.Row, error)

func (*VaccineClient) GetHospitals

func (vaccineClient *VaccineClient) GetHospitals(county string, township string) ([]bigtable.Row, error)

func (*VaccineClient) GetReservation

func (vaccineClient *VaccineClient) GetReservation(ID string, userID string) (bigtable.Row, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL