Documentation ¶
Index ¶
- Variables
- type Core
- func (c *Core) BatchCreate(ctx context.Context, cores []NewUnit) ([]Unit, error)
- func (c *Core) Create(ctx context.Context, core NewUnit) (Unit, error)
- func (c *Core) Delete(ctx context.Context, core Unit) (Unit, error)
- func (c *Core) DeleteByPropertyID(ctx context.Context, propertyID uuid.UUID) error
- func (c *Core) ExecuteUnderTransaction(tx transaction.Transaction) (*Core, error)
- func (c *Core) QueryByFloorID(ctx context.Context, id uuid.UUID) ([]Unit, error)
- func (c *Core) QueryByID(ctx context.Context, id uuid.UUID) (Unit, error)
- func (c *Core) QueryByPropertyID(ctx context.Context, id uuid.UUID) ([]Unit, error)
- func (c *Core) Update(ctx context.Context, o Unit, n UpdateUnit) (Unit, error)
- type NewUnit
- type Status
- type Storer
- type Unit
- type UpdateUnit
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StatusActive = Status{"ACTIVE"} StatusDeleted = Status{"DELETED"} )
Set of possible status for a user.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (*Core) BatchCreate ¶
func (*Core) DeleteByPropertyID ¶
func (*Core) ExecuteUnderTransaction ¶
func (c *Core) ExecuteUnderTransaction(tx transaction.Transaction) (*Core, error)
ExecuteUnderTransaction constructs a new Core value that will use the specified transaction in any store related calls.
func (*Core) QueryByFloorID ¶
func (*Core) QueryByPropertyID ¶
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status represents a user status in the system.
func MustParseStatus ¶
MustParseStatus parses the string value and returns a status if one exists. If an error occurs the function panics.
func ParseStatus ¶
ParseStatus parses the string value and returns a status if one exists.
func (*Status) MarshalText ¶
MarshalText implement the marshal interface for JSON conversions.
func (*Status) UnmarshalText ¶
UnmarshalText implement the unmarshal interface for JSON conversions.
type Storer ¶
type Storer interface { Create(ctx context.Context, core Unit) error BatchCreate(ctx context.Context, cores []Unit) error DeleteByPropertyID(ctx context.Context, id uuid.UUID) error Update(ctx context.Context, core Unit) error QueryByID(ctx context.Context, id uuid.UUID) (Unit, error) QueryByFloorID(ctx context.Context, id uuid.UUID) ([]Unit, error) QueryByPropertyID(ctx context.Context, id uuid.UUID) ([]Unit, error) ExecuteUnderTransaction(tx transaction.Transaction) (Storer, error) }
type UpdateUnit ¶
type UpdateUnit struct {
Name *string
}
Click to show internal directories.
Click to hide internal directories.