Documentation
¶
Index ¶
- Variables
- type Channel
- type ChannelApplet
- type ChannelSubscriber
- type Count
- type Device
- type SchemaVersion
- type Store
- func (store *Store) CreateChannel(ctx context.Context, name string, comment *string) (*Channel, error)
- func (store *Store) CreateChannelApplet(ctx context.Context, channelUUID uuid.UUID, app *ChannelApplet) error
- func (store *Store) DeleteChannel(ctx context.Context, channelUUID uuid.UUID) error
- func (store *Store) DeleteChannelApplet(ctx context.Context, channelUUID uuid.UUID, appletUUID uuid.UUID) error
- func (store *Store) DeleteDevice(ctx context.Context, uuid uuid.UUID) error
- func (store *Store) GetAllChannels(ctx context.Context) ([]Channel, error)
- func (store *Store) GetAllDevices(ctx context.Context) ([]Device, error)
- func (store *Store) GetChannelByName(ctx context.Context, name string) (*Channel, error)
- func (store *Store) GetChannelByUUID(ctx context.Context, uuid uuid.UUID) (*Channel, error)
- func (store *Store) GetDeviceByUUID(ctx context.Context, uuid uuid.UUID) (*Device, error)
- func (store *Store) LoginDevice(ctx context.Context, uuid uuid.UUID, remoteIP string) (*Device, error)
- func (store *Store) LogoutDevice(ctx context.Context, uuid uuid.UUID) error
- func (store *Store) ModifyChannel(ctx context.Context, uuid uuid.UUID, name *string, comment *string) error
- func (store *Store) ModifyChannelApplet(ctx context.Context, channelUUID uuid.UUID, appletUUID uuid.UUID, idx *int, ...) error
- func (store *Store) ModifyDevice(ctx context.Context, device *Device) error
- func (store *Store) Transaction(ctx context.Context, opts *sqlair.TXOptions, fn func(*TX) error) error
- func (store *Store) Update(ctx context.Context, fn func(*TX) error) error
- func (store *Store) View(ctx context.Context, fn func(*TX) error) error
- type TX
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultChannelUUID = uuid.MustParse("76ffcb18-d3c7-40d5-abea-3fe86d02a4ba")
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
UUID uuid.UUID `db:"uuid"`
Name string `db:"name"`
Comment *string `db:"comment"`
Applets []ChannelApplet
Subscribers []ChannelSubscriber
}
type ChannelApplet ¶
type ChannelSubscriber ¶
type SchemaVersion ¶
type SchemaVersion struct {
Version int `db:"version"`
}
type Store ¶
func NewStoreWithDB ¶
NewStoreWithDB creates a Store with a pre-initialized sqlair.DB. This is primarily used for testing with in-memory databases.
func (*Store) CreateChannel ¶
func (*Store) CreateChannelApplet ¶
func (*Store) DeleteChannel ¶
func (*Store) DeleteChannelApplet ¶
func (*Store) DeleteDevice ¶
func (*Store) GetAllChannels ¶
func (*Store) GetAllDevices ¶
func (*Store) GetChannelByName ¶
func (*Store) GetChannelByUUID ¶
func (*Store) GetDeviceByUUID ¶
func (*Store) LoginDevice ¶
func (*Store) LogoutDevice ¶
func (*Store) ModifyChannel ¶
func (*Store) ModifyChannelApplet ¶
func (*Store) ModifyDevice ¶
func (*Store) Transaction ¶
Click to show internal directories.
Click to hide internal directories.