Versions in this module Expand all Collapse all v0 v0.0.1 Jul 7, 2023 Changes in this version + const ModulationFSK + const ModulationLoRa + var ErrAPIKeyInvalidName = errors.New("invalid API Key name") + var ErrAlreadyExists = errors.New("object already exists") + var ErrApplicationInvalidName = errors.New("invalid application name") + var ErrCFListTooManyChannels = errors.New("too many channels in channel-list") + var ErrDeviceProfileInvalidName = errors.New("invalid device-profile name") + var ErrDoesNotExist = errors.New("object does not exist") + var ErrGatewayInvalidName = errors.New("invalid gateway name") + var ErrInvalidEmail = errors.New("invalid e-mail") + var ErrInvalidGatewayDiscoveryInterval = errors.New("invalid gateway-discovery interval, it must be greater than 0") + var ErrInvalidUsernameOrPassword = errors.New("invalid username or password") + var ErrMulticastGroupInvalidName = errors.New("invalid multicast-group name") + var ErrNetworkServerInvalidName = errors.New("invalid network-server name") + var ErrNodeInvalidName = errors.New("invalid node name") + var ErrNodeMaxRXDelay = errors.New("max value of RXDelay is 15") + var ErrOrganizationInvalidName = errors.New("invalid organization name") + var ErrOrganizationMaxDeviceCount = errors.New("organization reached max. device count") + var ErrOrganizationMaxGatewayCount = errors.New("organization reached max. gateway count") + var ErrServiceProfileInvalidName = errors.New("invalid service-profile name") + var ErrTransactionRollback = errors.New("rollback") + var ErrUsedByOtherObjects = errors.New("this object is used by other objects, remove them first") + var ErrUserInvalidUsername = errors.New(...) + var ErrUserPasswordLength = errors.New("passwords must be at least 6 characters long") + var HashIterations = 100000 + func AddDeviceToMulticastGroup(ctx context.Context, db sqlx.Ext, multicastGroupID uuid.UUID, ...) error + func CodeMigration(name string, f func(db sqlx.Ext) error) error + func CreateAPIKey(ctx context.Context, db sqlx.Ext, a *APIKey) (string, error) + func CreateApplication(ctx context.Context, db sqlx.Queryer, item *Application) error + func CreateDevice(ctx context.Context, db sqlx.Ext, d *Device) error + func CreateDeviceKeys(ctx context.Context, db sqlx.Execer, dc *DeviceKeys) error + func CreateDeviceProfile(ctx context.Context, db sqlx.Ext, dp *DeviceProfile) error + func CreateGateway(ctx context.Context, db sqlx.Execer, gw *Gateway) error + func CreateGatewayPing(ctx context.Context, db sqlx.Queryer, ping *GatewayPing) error + func CreateGatewayPingRX(ctx context.Context, db sqlx.Queryer, rx *GatewayPingRX) error + func CreateGatewayProfile(ctx context.Context, db sqlx.Ext, gp *GatewayProfile) error + func CreateIntegration(ctx context.Context, db sqlx.Queryer, i *Integration) error + func CreateMulticastGroup(ctx context.Context, db sqlx.Ext, mg *MulticastGroup) error + func CreateNetworkServer(ctx context.Context, db sqlx.Queryer, n *NetworkServer) error + func CreateOrganization(ctx context.Context, db sqlx.Queryer, org *Organization) error + func CreateOrganizationUser(ctx context.Context, db sqlx.Execer, organizationID, userID int64, ...) error + func CreateServiceProfile(ctx context.Context, db sqlx.Ext, sp *ServiceProfile) error + func CreateUser(ctx context.Context, db sqlx.Queryer, user *User) error + func DeleteAPIKey(ctx context.Context, db sqlx.Ext, id uuid.UUID) error + func DeleteAllApplicationsForOrganizationID(ctx context.Context, db sqlx.Ext, organizationID int64) error + func DeleteAllDeviceProfilesForOrganizationID(ctx context.Context, db sqlx.Ext, organizationID int64) error + func DeleteAllDevicesForApplicationID(ctx context.Context, db sqlx.Ext, applicationID int64) error + func DeleteAllGatewaysForOrganizationID(ctx context.Context, db sqlx.Ext, organizationID int64) error + func DeleteAllServiceProfilesForOrganizationID(ctx context.Context, db sqlx.Ext, organizationID int64) error + func DeleteApplication(ctx context.Context, db sqlx.Ext, id int64) error + func DeleteDevice(ctx context.Context, db sqlx.Ext, devEUI lorawan.EUI64) error + func DeleteDeviceKeys(ctx context.Context, db sqlx.Execer, devEUI lorawan.EUI64) error + func DeleteDeviceProfile(ctx context.Context, db sqlx.Ext, id uuid.UUID) error + func DeleteGateway(ctx context.Context, db sqlx.Ext, mac lorawan.EUI64) error + func DeleteGatewayProfile(ctx context.Context, db sqlx.Ext, id uuid.UUID) error + func DeleteIntegration(ctx context.Context, db sqlx.Execer, id int64) error + func DeleteMulticastGroup(ctx context.Context, db sqlx.Ext, id uuid.UUID) error + func DeleteNetworkServer(ctx context.Context, db sqlx.Ext, id int64) error + func DeleteOrganization(ctx context.Context, db sqlx.Ext, id int64) error + func DeleteOrganizationUser(ctx context.Context, db sqlx.Execer, organizationID, userID int64) error + func DeleteServiceProfile(ctx context.Context, db sqlx.Ext, id uuid.UUID) error + func DeleteUser(ctx context.Context, db sqlx.Execer, id int64) error + func EnqueueDownlinkPayload(ctx context.Context, db sqlx.Ext, devEUI lorawan.EUI64, confirmed bool, ...) (uint32, error) + func GetAPIKeyCount(ctx context.Context, db sqlx.Queryer, filters APIKeyFilters) (int, error) + func GetApplicationCount(ctx context.Context, db sqlx.Queryer, filters ApplicationFilters) (int, error) + func GetDeviceCount(ctx context.Context, db sqlx.Queryer, filters DeviceFilters) (int, error) + func GetDeviceCountForMulticastGroup(ctx context.Context, db sqlx.Queryer, multicastGroup uuid.UUID) (int, error) + func GetDeviceProfileCount(ctx context.Context, db sqlx.Queryer, filters DeviceProfileFilters) (int, error) + func GetGatewayCount(ctx context.Context, db sqlx.Queryer, filters GatewayFilters) (int, error) + func GetGatewayProfileCount(ctx context.Context, db sqlx.Queryer) (int, error) + func GetGatewayProfileCountForNetworkServerID(ctx context.Context, db sqlx.Queryer, networkServerID int64) (int, error) + func GetGatewaysForMACs(ctx context.Context, db sqlx.Queryer, macs []lorawan.EUI64) (map[lorawan.EUI64]Gateway, error) + func GetLastGatewayPingAndRX(ctx context.Context, db sqlx.Queryer, mac lorawan.EUI64) (GatewayPing, []GatewayPingRX, error) + func GetMulticastGroupCount(ctx context.Context, db sqlx.Queryer, filters MulticastGroupFilters) (int, error) + func GetNetworkServerCount(ctx context.Context, db sqlx.Queryer, filters NetworkServerFilters) (int, error) + func GetOrganizationCount(ctx context.Context, db sqlx.Queryer, filters OrganizationFilters) (int, error) + func GetOrganizationUserCount(ctx context.Context, db sqlx.Queryer, organizationID int64) (int, error) + func GetRedisKey(tmpl string, params ...interface{}) string + func GetServiceProfileCount(ctx context.Context, db sqlx.Queryer, filters ServiceProfileFilters) (int, error) + func GetUserCount(ctx context.Context, db sqlx.Queryer) (int, error) + func GetUserToken(u User) (string, error) + func LoginUserByPassword(ctx context.Context, db sqlx.Queryer, email string, password string) (string, error) + func MigrateDown(db *sqlx.DB) error + func MigrateUp(db *sqlx.DB) error + func RedisClient() redis.UniversalClient + func RemoveDeviceFromMulticastGroup(ctx context.Context, db sqlx.Ext, multicastGroupID uuid.UUID, ...) error + func SaveMetrics(ctx context.Context, name string, metrics MetricsRecord) error + func SaveMetricsForInterval(ctx context.Context, agg AggregationInterval, name string, ...) error + func SetAggregationIntervals(intervals []AggregationInterval) error + func SetMetricsTTL(minute, hour, day, month time.Duration) + func SetTimeLocation(name string) error + func Setup(c config.Config) error + func Transaction(f func(tx sqlx.Ext) error) error + func UpdateApplication(ctx context.Context, db sqlx.Execer, item Application) error + func UpdateDevice(ctx context.Context, db sqlx.Ext, d *Device, localOnly bool) error + func UpdateDeviceActivation(ctx context.Context, db sqlx.Ext, devEUI lorawan.EUI64, ...) error + func UpdateDeviceKeys(ctx context.Context, db sqlx.Execer, dc *DeviceKeys) error + func UpdateDeviceLastSeenAndDR(ctx context.Context, db sqlx.Ext, devEUI lorawan.EUI64, ts time.Time, dr int) error + func UpdateDeviceProfile(ctx context.Context, db sqlx.Ext, dp *DeviceProfile) error + func UpdateGateway(ctx context.Context, db sqlx.Execer, gw *Gateway) error + func UpdateGatewayProfile(ctx context.Context, db sqlx.Ext, gp *GatewayProfile) error + func UpdateIntegration(ctx context.Context, db sqlx.Execer, i *Integration) error + func UpdateMulticastGroup(ctx context.Context, db sqlx.Ext, mg *MulticastGroup) error + func UpdateNetworkServer(ctx context.Context, db sqlx.Execer, n *NetworkServer) error + func UpdateOrganization(ctx context.Context, db sqlx.Execer, org *Organization) error + func UpdateOrganizationUser(ctx context.Context, db sqlx.Execer, organizationID, userID int64, ...) error + func UpdateServiceProfile(ctx context.Context, db sqlx.Ext, sp *ServiceProfile) error + func UpdateUser(ctx context.Context, db sqlx.Execer, u *User) error + type APIKey struct + ApplicationID *int64 + CreatedAt time.Time + ID uuid.UUID + IsAdmin bool + Name string + OrganizationID *int64 + func GetAPIKey(ctx context.Context, db sqlx.Queryer, id uuid.UUID) (APIKey, error) + func GetAPIKeys(ctx context.Context, db sqlx.Queryer, filters APIKeyFilters) ([]APIKey, error) + func (a APIKey) Validate() error + type APIKeyFilters struct + ApplicationID *int64 + IsAdmin bool + Limit int + Offset int + OrganizationID *int64 + func (f APIKeyFilters) SQL() string + type Action int + const Delete + const Insert + const Scan + const Select + const Update + type AggregationInterval string + const AggregationDay + const AggregationHour + const AggregationMinute + const AggregationMonth + type Application struct + Description string + ID int64 + MQTTTLSCert []byte + Name string + OrganizationID int64 + PayloadCodec codec.Type + PayloadDecoderScript string + PayloadEncoderScript string + ServiceProfileID uuid.UUID + func GetApplication(ctx context.Context, db sqlx.Queryer, id int64) (Application, error) + func (a Application) Validate() error + type ApplicationFilters struct + Limit int + Offset int + OrganizationID int64 + Search string + UserID int64 + func (f ApplicationFilters) SQL() string + type ApplicationListItem struct + ServiceProfileName string + func GetApplications(ctx context.Context, db sqlx.Queryer, filters ApplicationFilters) ([]ApplicationListItem, error) + type DBLogger struct + func DB() *DBLogger + func (db *DBLogger) Beginx() (*TxLogger, error) + func (db *DBLogger) Exec(query string, args ...interface{}) (sql.Result, error) + func (db *DBLogger) Query(query string, args ...interface{}) (*sql.Rows, error) + func (db *DBLogger) QueryRowx(query string, args ...interface{}) *sqlx.Row + func (db *DBLogger) Queryx(query string, args ...interface{}) (*sqlx.Rows, error) + type Device struct + Altitude *float64 + AppSKey lorawan.AES128Key + ApplicationID int64 + CreatedAt time.Time + DR *int + Description string + DevAddr lorawan.DevAddr + DevEUI lorawan.EUI64 + DeviceProfileID uuid.UUID + DeviceStatusBattery *float32 + DeviceStatusExternalPower bool + DeviceStatusMargin *int + IsDisabled bool + LastSeenAt *time.Time + Latitude *float64 + Longitude *float64 + Name string + ReferenceAltitude float64 + SkipFCntCheck bool + Tags hstore.Hstore + UpdatedAt time.Time + Variables hstore.Hstore + func GetDevice(ctx context.Context, db sqlx.Queryer, devEUI lorawan.EUI64, ...) (Device, error) + func (d Device) Validate() error + type DeviceFilters struct + ApplicationID int64 + Limit int + MulticastGroupID uuid.UUID + Offset int + OrganizationID int64 + Search string + ServiceProfileID uuid.UUID + Tags hstore.Hstore + func (f DeviceFilters) SQL() string + type DeviceKeys struct + AppKey lorawan.AES128Key + CreatedAt time.Time + DevEUI lorawan.EUI64 + JoinNonce int + NwkKey lorawan.AES128Key + UpdatedAt time.Time + func GetDeviceKeys(ctx context.Context, db sqlx.Queryer, devEUI lorawan.EUI64) (DeviceKeys, error) + type DeviceListItem struct + DeviceProfileName string + func GetDevices(ctx context.Context, db sqlx.Queryer, filters DeviceFilters) ([]DeviceListItem, error) + func GetDevicesForMulticastGroup(ctx context.Context, db sqlx.Queryer, multicastGroupID uuid.UUID, ...) ([]DeviceListItem, error) + type DeviceProfile struct + CreatedAt time.Time + DeviceProfile ns.DeviceProfile + Name string + NetworkServerID int64 + OrganizationID int64 + PayloadCodec codec.Type + PayloadDecoderScript string + PayloadEncoderScript string + Tags hstore.Hstore + UpdatedAt time.Time + UplinkInterval time.Duration + func GetDeviceProfile(ctx context.Context, db sqlx.Queryer, id uuid.UUID, forUpdate, localOnly bool) (DeviceProfile, error) + func (dp DeviceProfile) Validate() error + type DeviceProfileFilters struct + ApplicationID int64 + Limit int + Offset int + OrganizationID int64 + UserID int64 + func (f DeviceProfileFilters) SQL() string + type DeviceProfileMeta struct + CreatedAt time.Time + DeviceProfileID uuid.UUID + Name string + NetworkServerID int64 + NetworkServerName string + OrganizationID int64 + UpdatedAt time.Time + func GetDeviceProfiles(ctx context.Context, db sqlx.Queryer, filters DeviceProfileFilters) ([]DeviceProfileMeta, error) + type DevicesActiveInactive struct + ActiveCount uint32 + InactiveCount uint32 + NeverSeenCount uint32 + func GetDevicesActiveInactive(ctx context.Context, db sqlx.Queryer, organizationID int64) (DevicesActiveInactive, error) + type DevicesDataRates map[uint32]uint32 + func GetDevicesDataRates(ctx context.Context, db sqlx.Queryer, organizationID int64) (DevicesDataRates, error) + type ExtraChannel struct + Bandwidth int + Bitrate int + Frequency int + Modulation string + SpreadingFactors []int + type GPSPoint struct + Latitude float64 + Longitude float64 + func (l *GPSPoint) Scan(src interface{}) error + func (l GPSPoint) Value() (driver.Value, error) + type Gateway struct + Altitude float64 + CreatedAt time.Time + Description string + FirstSeenAt *time.Time + GatewayProfileID *uuid.UUID + LastPingID *int64 + LastPingSentAt *time.Time + LastSeenAt *time.Time + Latitude float64 + Longitude float64 + MAC lorawan.EUI64 + Metadata hstore.Hstore + Name string + NetworkServerID int64 + OrganizationID int64 + Ping bool + ServiceProfileID *uuid.UUID + Tags hstore.Hstore + UpdatedAt time.Time + func GetGateway(ctx context.Context, db sqlx.Queryer, mac lorawan.EUI64, forUpdate bool) (Gateway, error) + func (g Gateway) Validate() error + type GatewayFilters struct + Limit int + Offset int + OrganizationID int64 + Search string + UserID int64 + func (f GatewayFilters) SQL() string + type GatewayListItem struct + Altitude float64 + CreatedAt time.Time + Description string + FirstSeenAt *time.Time + LastSeenAt *time.Time + Latitude float64 + Longitude float64 + MAC lorawan.EUI64 + Name string + NetworkServerID int64 + NetworkServerName string + OrganizationID int64 + UpdatedAt time.Time + func GetGateways(ctx context.Context, db sqlx.Queryer, filters GatewayFilters) ([]GatewayListItem, error) + type GatewayPing struct + CreatedAt time.Time + DR int + Frequency int + GatewayMAC lorawan.EUI64 + ID int64 + func GetGatewayPing(ctx context.Context, db sqlx.Queryer, id int64) (GatewayPing, error) + type GatewayPingRX struct + Altitude float64 + CreatedAt time.Time + GatewayMAC lorawan.EUI64 + ID int64 + LoRaSNR float64 + Location GPSPoint + PingID int64 + RSSI int + ReceivedAt *time.Time + func GetGatewayPingRXForPingID(ctx context.Context, db sqlx.Queryer, pingID int64) ([]GatewayPingRX, error) + type GatewayProfile struct + CreatedAt time.Time + GatewayProfile ns.GatewayProfile + Name string + NetworkServerID int64 + UpdatedAt time.Time + func GetGatewayProfile(ctx context.Context, db sqlx.Queryer, id uuid.UUID) (GatewayProfile, error) + type GatewayProfileMeta struct + CreatedAt time.Time + GatewayProfileID uuid.UUID + Name string + NetworkServerID int64 + NetworkServerName string + StatsInterval time.Duration + UpdatedAt time.Time + func GetGatewayProfiles(ctx context.Context, db sqlx.Queryer, limit, offset int) ([]GatewayProfileMeta, error) + func GetGatewayProfilesForNetworkServerID(ctx context.Context, db sqlx.Queryer, networkServerID int64, limit, offset int) ([]GatewayProfileMeta, error) + type GatewaysActiveInactive struct + ActiveCount uint32 + InactiveCount uint32 + NeverSeenCount uint32 + func GetGatewaysActiveInactive(ctx context.Context, db sqlx.Queryer, organizationID int64) (GatewaysActiveInactive, error) + type Integration struct + ApplicationID int64 + CreatedAt time.Time + ID int64 + Kind string + Settings json.RawMessage + UpdatedAt time.Time + func GetIntegration(ctx context.Context, db sqlx.Queryer, id int64) (Integration, error) + func GetIntegrationByApplicationID(ctx context.Context, db sqlx.Queryer, applicationID int64, kind string) (Integration, error) + func GetIntegrationsForApplicationID(ctx context.Context, db sqlx.Queryer, applicationID int64) ([]Integration, error) + type MetricsRecord struct + Metrics map[string]float64 + Time time.Time + func GetMetrics(ctx context.Context, agg AggregationInterval, name string, ...) ([]MetricsRecord, error) + type MulticastGroup struct + ApplicationID int64 + CreatedAt time.Time + MCAppSKey lorawan.AES128Key + MulticastGroup ns.MulticastGroup + Name string + UpdatedAt time.Time + func GetMulticastGroup(ctx context.Context, db sqlx.Queryer, id uuid.UUID, forUpdate, localOnly bool) (MulticastGroup, error) + func (mg MulticastGroup) Validate() error + type MulticastGroupFilters struct + ApplicationID int64 + DevEUI lorawan.EUI64 + Limit int + Offset int + OrganizationID int64 + Search string + func (f MulticastGroupFilters) SQL() string + type MulticastGroupListItem struct + ApplicationID int64 + ApplicationName string + CreatedAt time.Time + ID uuid.UUID + Name string + UpdatedAt time.Time + func GetMulticastGroups(ctx context.Context, db sqlx.Queryer, filters MulticastGroupFilters) ([]MulticastGroupListItem, error) + type NetworkServer struct + CACert string + CreatedAt time.Time + GatewayDiscoveryDR int + GatewayDiscoveryEnabled bool + GatewayDiscoveryInterval int + GatewayDiscoveryTXFrequency int + ID int64 + Name string + RoutingProfileCACert string + RoutingProfileTLSCert string + RoutingProfileTLSKey string + Server string + TLSCert string + TLSKey string + UpdatedAt time.Time + func GetNetworkServer(ctx context.Context, db sqlx.Queryer, id int64) (NetworkServer, error) + func GetNetworkServerForApplicationID(ctx context.Context, db sqlx.Queryer, id int64) (NetworkServer, error) + func GetNetworkServerForDevEUI(ctx context.Context, db sqlx.Queryer, devEUI lorawan.EUI64) (NetworkServer, error) + func GetNetworkServerForDeviceProfileID(ctx context.Context, db sqlx.Queryer, id uuid.UUID) (NetworkServer, error) + func GetNetworkServerForGatewayMAC(ctx context.Context, db sqlx.Queryer, mac lorawan.EUI64) (NetworkServer, error) + func GetNetworkServerForGatewayProfileID(ctx context.Context, db sqlx.Queryer, id uuid.UUID) (NetworkServer, error) + func GetNetworkServerForMulticastGroupID(ctx context.Context, db sqlx.Queryer, id uuid.UUID) (NetworkServer, error) + func GetNetworkServerForServiceProfileID(ctx context.Context, db sqlx.Queryer, id uuid.UUID) (NetworkServer, error) + func GetNetworkServers(ctx context.Context, db sqlx.Queryer, filters NetworkServerFilters) ([]NetworkServer, error) + func (ns NetworkServer) Validate() error + type NetworkServerFilters struct + Limit int + Offset int + OrganizationID int64 + func (f NetworkServerFilters) SQL() string + type Organization struct + CanHaveGateways bool + CreatedAt time.Time + DisplayName string + ID int64 + MaxDeviceCount int + MaxGatewayCount int + Name string + UpdatedAt time.Time + func GetOrganization(ctx context.Context, db sqlx.Queryer, id int64, forUpdate bool) (Organization, error) + func GetOrganizations(ctx context.Context, db sqlx.Queryer, filters OrganizationFilters) ([]Organization, error) + func (o Organization) Validate() error + type OrganizationFilters struct + Limit int + Offset int + Search string + UserID int64 + func (f OrganizationFilters) SQL() string + type OrganizationUser struct + CreatedAt time.Time + Email string + IsAdmin bool + IsDeviceAdmin bool + IsGatewayAdmin bool + UpdatedAt time.Time + UserID int64 + func GetOrganizationUser(ctx context.Context, db sqlx.Queryer, organizationID, userID int64) (OrganizationUser, error) + func GetOrganizationUsers(ctx context.Context, db sqlx.Queryer, organizationID int64, limit, offset int) ([]OrganizationUser, error) + type SearchResult struct + ApplicationID *int64 + ApplicationName *string + DeviceDevEUI *lorawan.EUI64 + DeviceName *string + GatewayMAC *lorawan.EUI64 + GatewayName *string + Kind string + OrganizationID *int64 + OrganizationName *string + Score float64 + func GlobalSearch(ctx context.Context, db sqlx.Queryer, userID int64, globalAdmin bool, ...) ([]SearchResult, error) + type ServiceProfile struct + CreatedAt time.Time + Name string + NetworkServerID int64 + OrganizationID int64 + ServiceProfile ns.ServiceProfile + UpdatedAt time.Time + func GetServiceProfile(ctx context.Context, db sqlx.Queryer, id uuid.UUID, localOnly bool) (ServiceProfile, error) + func (sp ServiceProfile) Validate() error + type ServiceProfileFilters struct + Limit int + NetworkServerID int64 + Offset int + OrganizationID int64 + UserID int64 + func (f ServiceProfileFilters) SQL() string + type ServiceProfileMeta struct + CreatedAt time.Time + Name string + NetworkServerID int64 + NetworkServerName string + OrganizationID int64 + ServiceProfileID uuid.UUID + UpdatedAt time.Time + func GetServiceProfiles(ctx context.Context, db sqlx.Queryer, filters ServiceProfileFilters) ([]ServiceProfileMeta, error) + type TxLogger struct + func (q *TxLogger) Exec(query string, args ...interface{}) (sql.Result, error) + func (q *TxLogger) Query(query string, args ...interface{}) (*sql.Rows, error) + func (q *TxLogger) QueryRowx(query string, args ...interface{}) *sqlx.Row + func (q *TxLogger) Queryx(query string, args ...interface{}) (*sqlx.Rows, error) + type User struct + CreatedAt time.Time + Email string + EmailOld string + EmailVerified bool + ExternalID *string + ID int64 + IsActive bool + IsAdmin bool + Note string + PasswordHash string + SessionTTL int32 + UpdatedAt time.Time + func GetUser(ctx context.Context, db sqlx.Queryer, id int64) (User, error) + func GetUserByEmail(ctx context.Context, db sqlx.Queryer, email string) (User, error) + func GetUserByExternalID(ctx context.Context, db sqlx.Queryer, externalID string) (User, error) + func GetUsers(ctx context.Context, db sqlx.Queryer, limit, offset int) ([]User, error) + func (u *User) SetPasswordHash(pw string) error + func (u User) Validate() error + type UserProfile struct + Organizations []UserProfileOrganization + User UserProfileUser + func GetProfile(ctx context.Context, db sqlx.Queryer, id int64) (UserProfile, error) + type UserProfileOrganization struct + CreatedAt time.Time + ID int64 + IsAdmin bool + IsDeviceAdmin bool + IsGatewayAdmin bool + Name string + UpdatedAt time.Time + type UserProfileUser struct + CreatedAt time.Time + Email string + ID int64 + IsActive bool + IsAdmin bool + SessionTTL int32 + UpdatedAt time.Time