mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
<!-- 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.
29 lines
1 KiB
Go
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
|
|
}
|