Documentation ¶
Index ¶
- func Encode(data []byte) string
- func EncodeSlice(data [][]byte) []string
- func LockError(context services.Context) services.Response
- func SignedAppointment(validateSettings *services.ValidateSettings, data []byte) (*services.SignedAppointment, error)
- func SignedProviderData(data []byte) (*services.SignedProviderData, error)
- type AppointmentDatesByID
- type AppointmentDatesByProperty
- type Appointments
- func (c *Appointments) Key(key string) *crypto.Key
- func (c *Appointments) LockAppointment(appointmentId []byte) (services.Lock, error)
- func (c *Appointments) LockProvider(providerId []byte) (services.Lock, error)
- func (c *Appointments) LockToken(token []byte) (services.Lock, error)
- func (c *Appointments) LockUser(userId []byte) (services.Lock, error)
- type AppointmentsBackend
- func (a *AppointmentsBackend) AppointmentDatesByID(providerID []byte) *AppointmentDatesByID
- func (a *AppointmentsBackend) AppointmentDatesByProperty(providerID []byte, key string, value string) *AppointmentDatesByProperty
- func (a *AppointmentsBackend) AppointmentsByDate(providerID []byte, date string) *AppointmentsByDate
- func (a *AppointmentsBackend) Codes(actor string) *Codes
- func (a *AppointmentsBackend) ConfirmedProviderData() *ConfirmedProviderData
- func (a *AppointmentsBackend) Keys(actor string) *Keys
- func (a *AppointmentsBackend) Neighbors(neighborType, zipCode string) *Neighbors
- func (a *AppointmentsBackend) PriorityToken(name string) *PriorityToken
- func (a *AppointmentsBackend) ProviderStatus() *ProviderStatus
- func (a *AppointmentsBackend) PublicProviderData() *PublicProviderData
- func (a *AppointmentsBackend) UnverifiedProviderData() *RawProviderData
- func (a *AppointmentsBackend) UsedTokens() *UsedTokens
- func (a *AppointmentsBackend) VerifiedProviderData() *RawProviderData
- type AppointmentsByDate
- func (a *AppointmentsByDate) Del(id []byte) error
- func (a *AppointmentsByDate) Get(validateSettings *services.ValidateSettings, id []byte) (*services.SignedAppointment, error)
- func (a *AppointmentsByDate) GetAll(validateSettings *services.ValidateSettings) (map[string]*services.SignedAppointment, error)
- func (a *AppointmentsByDate) Set(appointment *services.SignedAppointment) error
- type Codes
- type ConfirmedProviderData
- type Keys
- type Neighbors
- type PriorityToken
- type ProviderStatus
- type PublicProviderData
- type RawProviderData
- func (c *RawProviderData) Del(providerID []byte) error
- func (c *RawProviderData) Get(providerID []byte) (*services.RawProviderData, error)
- func (c *RawProviderData) GetAll() (map[string]*services.RawProviderData, error)
- func (c *RawProviderData) Set(providerID []byte, rawData *services.RawProviderData) error
- type Server
- type Storage
- type UsedTokens
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
in principle JSON will encode binary data as base64, but we do the conversion explicitly just to avoid any potential inconsistencies that might arise in the future...
func EncodeSlice ¶
in principle JSON will encode binary data as base64, but we do the conversion explicitly just to avoid any potential inconsistencies that might arise in the future...
func SignedAppointment ¶
func SignedProviderData ¶
Types ¶
type AppointmentDatesByID ¶
type AppointmentDatesByID struct {
// contains filtered or unexported fields
}
func (*AppointmentDatesByID) Del ¶
func (a *AppointmentDatesByID) Del(id []byte) error
type AppointmentDatesByProperty ¶
type AppointmentDatesByProperty struct {
// contains filtered or unexported fields
}
func (*AppointmentDatesByProperty) Del ¶
func (a *AppointmentDatesByProperty) Del(id []byte) error
func (*AppointmentDatesByProperty) Get ¶
func (a *AppointmentDatesByProperty) Get(id []byte) (string, error)
type Appointments ¶
type Appointments struct { *Server // contains filtered or unexported fields }
func MakeAppointments ¶
func MakeAppointments(settings *services.Settings) (*Appointments, error)
func (*Appointments) LockAppointment ¶
func (c *Appointments) LockAppointment( appointmentId []byte, ) (services.Lock, error)
appointment locks prevent concurrent changes in the appointment data (like bookings) which may lead to race conditions resulting in bookings getting lost
func (*Appointments) LockProvider ¶
func (c *Appointments) LockProvider( providerId []byte, ) (services.Lock, error)
provider locks prohibit the provider and mediator to change data concurrently which may lead to inconsisten data
func (*Appointments) LockToken ¶
func (c *Appointments) LockToken( token []byte, ) (services.Lock, error)
token locks prevent double spending of tokens
func (*Appointments) LockUser ¶
func (c *Appointments) LockUser( userId []byte, ) (services.Lock, error)
user lock prevents race conditions when checking the token limit per user
type AppointmentsBackend ¶
type AppointmentsBackend struct {
// contains filtered or unexported fields
}
The appointments backend acts as an interface between the API and the database. It is mostly concerned with ensuring data is propery serialized and deserialized when stored or fetched from the database.
func (*AppointmentsBackend) AppointmentDatesByID ¶
func (a *AppointmentsBackend) AppointmentDatesByID(providerID []byte) *AppointmentDatesByID
func (*AppointmentsBackend) AppointmentDatesByProperty ¶
func (a *AppointmentsBackend) AppointmentDatesByProperty( providerID []byte, key string, value string, ) *AppointmentDatesByProperty
func (*AppointmentsBackend) AppointmentsByDate ¶
func (a *AppointmentsBackend) AppointmentsByDate( providerID []byte, date string, ) *AppointmentsByDate
func (*AppointmentsBackend) Codes ¶
func (a *AppointmentsBackend) Codes(actor string) *Codes
func (*AppointmentsBackend) ConfirmedProviderData ¶
func (a *AppointmentsBackend) ConfirmedProviderData() *ConfirmedProviderData
func (*AppointmentsBackend) Keys ¶
func (a *AppointmentsBackend) Keys(actor string) *Keys
func (*AppointmentsBackend) Neighbors ¶
func (a *AppointmentsBackend) Neighbors(neighborType, zipCode string) *Neighbors
func (*AppointmentsBackend) PriorityToken ¶
func (a *AppointmentsBackend) PriorityToken(name string) *PriorityToken
func (*AppointmentsBackend) ProviderStatus ¶ added in v0.8.1
func (a *AppointmentsBackend) ProviderStatus() *ProviderStatus
func (*AppointmentsBackend) PublicProviderData ¶
func (a *AppointmentsBackend) PublicProviderData() *PublicProviderData
func (*AppointmentsBackend) UnverifiedProviderData ¶
func (a *AppointmentsBackend) UnverifiedProviderData() *RawProviderData
func (*AppointmentsBackend) UsedTokens ¶
func (a *AppointmentsBackend) UsedTokens() *UsedTokens
func (*AppointmentsBackend) VerifiedProviderData ¶
func (a *AppointmentsBackend) VerifiedProviderData() *RawProviderData
type AppointmentsByDate ¶
type AppointmentsByDate struct {
// contains filtered or unexported fields
}
func (*AppointmentsByDate) Del ¶
func (a *AppointmentsByDate) Del(id []byte) error
func (*AppointmentsByDate) Get ¶
func (a *AppointmentsByDate) Get(validateSettings *services.ValidateSettings, id []byte) (*services.SignedAppointment, error)
func (*AppointmentsByDate) GetAll ¶
func (a *AppointmentsByDate) GetAll(validateSettings *services.ValidateSettings) (map[string]*services.SignedAppointment, error)
func (*AppointmentsByDate) Set ¶
func (a *AppointmentsByDate) Set(appointment *services.SignedAppointment) error
type ConfirmedProviderData ¶
type ConfirmedProviderData struct {
// contains filtered or unexported fields
}
func (*ConfirmedProviderData) Get ¶
func (c *ConfirmedProviderData) Get(providerID []byte) (*services.ConfirmedProviderData, error)
func (*ConfirmedProviderData) Set ¶
func (c *ConfirmedProviderData) Set(providerID []byte, encryptedData *services.ConfirmedProviderData) error
type PriorityToken ¶
type PriorityToken struct {
// contains filtered or unexported fields
}
type ProviderStatus ¶ added in v0.8.1
type ProviderStatus struct {
// contains filtered or unexported fields
}
type PublicProviderData ¶
type PublicProviderData struct {
// contains filtered or unexported fields
}
func (*PublicProviderData) Get ¶
func (p *PublicProviderData) Get(id []byte) (*services.SignedProviderData, error)
func (*PublicProviderData) Set ¶
func (p *PublicProviderData) Set(id []byte, signedProviderData *services.SignedProviderData) error
type RawProviderData ¶
type RawProviderData struct {
// contains filtered or unexported fields
}
func (*RawProviderData) Del ¶
func (c *RawProviderData) Del(providerID []byte) error
func (*RawProviderData) Get ¶
func (c *RawProviderData) Get(providerID []byte) (*services.RawProviderData, error)
func (*RawProviderData) GetAll ¶
func (c *RawProviderData) GetAll() (map[string]*services.RawProviderData, error)
func (*RawProviderData) Set ¶
func (c *RawProviderData) Set(providerID []byte, rawData *services.RawProviderData) error
type Storage ¶
type Storage struct { *Server // contains filtered or unexported fields }
func MakeStorage ¶
type UsedTokens ¶
type UsedTokens struct {
// contains filtered or unexported fields
}
func (*UsedTokens) Add ¶
func (t *UsedTokens) Add(token []byte) error
func (*UsedTokens) Del ¶
func (t *UsedTokens) Del(token []byte) error
Source Files ¶
- app_anon_get_appointment.go
- app_anon_get_appointments_aggregated.go
- app_anon_get_appointments_by_zip_code.go
- app_anon_get_configurables.go
- app_anon_get_keys.go
- app_anon_get_providers_by_zip_code.go
- app_anon_get_stats.go
- app_backend.go
- app_conversion.go
- app_locks.go
- app_mediator_confirm_provider.go
- app_mediator_get_pending_provider_data.go
- app_mediator_get_proivders.go
- app_mediator_get_provider.go
- app_mediator_get_verified_provider_data.go
- app_mediator_is_valid.go
- app_provider_check_data.go
- app_provider_check_status.go
- app_provider_get_appointments.go
- app_provider_get_appointments_by_property.go
- app_provider_is_valid.go
- app_provider_is_validated.go
- app_provider_publish_appointments.go
- app_provider_store_data.go
- app_root_add_codes.go
- app_root_add_mediator_public_key.go
- app_root_reset_db.go
- app_root_upload_distances.go
- app_user_book_appointment.go
- app_user_cancel_appointment.go
- app_user_get_token.go
- app_user_is_valid.go
- appointments.go
- helpers.go
- server.go
- sto_delete_settings.go
- sto_get_settings.go
- sto_reset_database.go
- sto_store_settings.go
- storage.go