fleet/server/mdm/android/datastore.go
Victor Lyuboslavsky e872f9a984
Update golangci-lint to v2.4.0 (#33251)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #33250

Waived most new failures. Planning to come back and fix some of them in
subsequent PRs.
2025-09-22 13:17:11 -05:00

29 lines
1 KiB
Go

package android
import (
"context"
"github.com/jmoiron/sqlx"
)
// MySQLTables are the tables that are present in Android's schema.sql
// This is an optimization/encapsulation exercise -- Android Datastore is only unit tested with the tables it uses.
func MySQLTables() []string {
return []string{
"android_enterprises",
"android_devices",
}
}
type Datastore interface {
CreateEnterprise(ctx context.Context, userID uint) (uint, error)
GetEnterpriseByID(ctx context.Context, id uint) (*EnterpriseDetails, error)
GetEnterpriseBySignupToken(ctx context.Context, signupToken string) (*EnterpriseDetails, error)
GetEnterprise(ctx context.Context) (*Enterprise, error)
UpdateEnterprise(ctx context.Context, enterprise *EnterpriseDetails) error
DeleteAllEnterprises(ctx context.Context) error
DeleteOtherEnterprises(ctx context.Context, id uint) error
CreateDeviceTx(ctx context.Context, tx sqlx.ExtContext, device *Device) (*Device, error)
UpdateDeviceTx(ctx context.Context, tx sqlx.ExtContext, device *Device) error
}