Documentation ¶
Index ¶
- type Building
- type DynamoConfig
- type DynamoRegistrar
- func (dr *DynamoRegistrar) DeregisterBuilding(ctx context.Context, buildingID string) (err error)
- func (dr *DynamoRegistrar) DeregisterResident(ctx context.Context, residentID string) (err error)
- func (dr *DynamoRegistrar) DeregisterUnit(ctx context.Context, unitID string) (err error)
- func (dr *DynamoRegistrar) GetBuildingByID(ctx context.Context, buildingID string) (building *Building, err error)
- func (dr *DynamoRegistrar) GetResidentByID(ctx context.Context, residentID string) (resident *Resident, err error)
- func (dr *DynamoRegistrar) ListBuildingUnits(ctx context.Context, buildingID string) (units []*Unit, err error)
- func (dr *DynamoRegistrar) ListBuildings(ctx context.Context) (buildings []*Building, err error)
- func (dr *DynamoRegistrar) ListUnitResidents(ctx context.Context, unitID string) (residents []*Resident, err error)
- func (dr *DynamoRegistrar) MoveResidentIn(ctx context.Context, residentID, unitID string) (err error)
- func (dr *DynamoRegistrar) MoveResidentOut(ctx context.Context, residentID, unitID string) (err error)
- func (dr *DynamoRegistrar) RegisterBuilding(ctx context.Context, in *Building) (building *Building, err error)
- func (dr *DynamoRegistrar) RegisterResident(ctx context.Context, in *Resident) (out *Resident, err error)
- func (dr *DynamoRegistrar) RegisterUnit(ctx context.Context, buildingID string, in *Unit) (unit *Unit, err error)
- type Registrar
- type Resident
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamoConfig ¶
DynamoConfig holds config options for DynamoRegistrar
type DynamoRegistrar ¶
type DynamoRegistrar struct { DB dynamodbiface.DynamoDBAPI Config *DynamoConfig }
DynamoRegistrar implements Registrar using dynamodb
func (*DynamoRegistrar) DeregisterBuilding ¶
func (dr *DynamoRegistrar) DeregisterBuilding(ctx context.Context, buildingID string) (err error)
DeregisterBuilding implements Registrar
func (*DynamoRegistrar) DeregisterResident ¶
func (dr *DynamoRegistrar) DeregisterResident(ctx context.Context, residentID string) (err error)
DeregisterResident implements Registrar
func (*DynamoRegistrar) DeregisterUnit ¶
func (dr *DynamoRegistrar) DeregisterUnit(ctx context.Context, unitID string) (err error)
DeregisterUnit implements Registrar
func (*DynamoRegistrar) GetBuildingByID ¶
func (dr *DynamoRegistrar) GetBuildingByID(ctx context.Context, buildingID string) (building *Building, err error)
GetBuildingByID implements registrar
func (*DynamoRegistrar) GetResidentByID ¶
func (dr *DynamoRegistrar) GetResidentByID(ctx context.Context, residentID string) (resident *Resident, err error)
GetResidentByID implements registrar
func (*DynamoRegistrar) ListBuildingUnits ¶
func (dr *DynamoRegistrar) ListBuildingUnits(ctx context.Context, buildingID string) (units []*Unit, err error)
ListBuildingUnits implements Registrar
func (*DynamoRegistrar) ListBuildings ¶
func (dr *DynamoRegistrar) ListBuildings(ctx context.Context) (buildings []*Building, err error)
ListBuildings returns list of all buildings
func (*DynamoRegistrar) ListUnitResidents ¶
func (dr *DynamoRegistrar) ListUnitResidents(ctx context.Context, unitID string) (residents []*Resident, err error)
ListUnitResidents implements Registrar
func (*DynamoRegistrar) MoveResidentIn ¶
func (dr *DynamoRegistrar) MoveResidentIn(ctx context.Context, residentID, unitID string) (err error)
MoveResidentIn implements Registrar
func (*DynamoRegistrar) MoveResidentOut ¶
func (dr *DynamoRegistrar) MoveResidentOut(ctx context.Context, residentID, unitID string) (err error)
MoveResidentOut implements Registrar
func (*DynamoRegistrar) RegisterBuilding ¶
func (dr *DynamoRegistrar) RegisterBuilding(ctx context.Context, in *Building) (building *Building, err error)
RegisterBuilding implements Registrar
func (*DynamoRegistrar) RegisterResident ¶
func (dr *DynamoRegistrar) RegisterResident(ctx context.Context, in *Resident) (out *Resident, err error)
RegisterResident implements Registrar
func (*DynamoRegistrar) RegisterUnit ¶
func (dr *DynamoRegistrar) RegisterUnit(ctx context.Context, buildingID string, in *Unit) (unit *Unit, err error)
RegisterUnit implements Registrar
type Registrar ¶
type Registrar interface { ListBuildings(ctx context.Context) (buildings []*Building, err error) GetBuildingByID(ctx context.Context, buildingID string) (building *Building, err error) RegisterBuilding(ctx context.Context, in *Building) (building *Building, err error) DeregisterBuilding(ctx context.Context, buildingID string) (err error) ListBuildingUnits(ctx context.Context, buildingID string) (units []*Unit, err error) // register unit RegisterUnit(ctx context.Context, buildingID string, in *Unit) (unit *Unit, err error) DeregisterUnit(ctx context.Context, unitID string) (err error) ListUnitResidents(ctx context.Context, unitID string) (residents []*Resident, err error) GetResidentByID(ctx context.Context, residentID string) (resident *Resident, err error) // adds a resident into the registry, optionally attaching the resident to // a unit if unitID is not empty. RegisterResident(ctx context.Context, resident *Resident) (returned *Resident, err error) DeregisterResident(ctx context.Context, residentID string) (err error) // moves a resident to a new unit MoveResidentIn(ctx context.Context, residentID, newUnitID string) (err error) // moves a resident out of a unitj MoveResidentOut(ctx context.Context, residentID, unitID string) (err error) }
Registrar maintains a registry of units and residents