Help us shape the future of Go! Take the 2026 Go Developer Survey

school

package
v1.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeDevice added in v1.32.0

func DescribeDevice(d jamfschool.Device) string

DescribeDevice renders a device as name, serial and UDID for confirmations and ambiguity refusals.

Types

type ErrNotFound

type ErrNotFound struct {
	ResourceType string
	Name         string
	Hint         string // e.g. "use 'school devices list' to see available devices"
}

ErrNotFound indicates a resource was not found by name during resolution.

func (*ErrNotFound) Error

func (e *ErrNotFound) Error() string

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver maps resource names to IDs/UUIDs. Results are cached per resource type to avoid redundant list calls within a single command.

func NewResolver

func NewResolver(client registry.SchoolClient) *Resolver

NewResolver creates a Resolver for the given School client.

func (*Resolver) ResolveAppID

func (r *Resolver) ResolveAppID(ctx context.Context, name string) (int64, error)

ResolveAppID returns the ID for an app given its name.

func (*Resolver) ResolveClassUUID

func (r *Resolver) ResolveClassUUID(ctx context.Context, name string) (string, error)

ResolveClassUUID returns the UUID for a class given its name.

func (*Resolver) ResolveDevice added in v1.32.0

func (r *Resolver) ResolveDevice(ctx context.Context, arg string) (jamfschool.Device, error)

ResolveDevice returns the one device identified by arg, matched as an exact UDID, then serial number, then name. The first identifier that matches decides, so a device named after another device's serial cannot capture it.

func (*Resolver) ResolveDeviceGroupID

func (r *Resolver) ResolveDeviceGroupID(ctx context.Context, name string) (int64, error)

ResolveDeviceGroupID returns the ID for a device group given its name.

func (*Resolver) ResolveDeviceUDID

func (r *Resolver) ResolveDeviceUDID(ctx context.Context, arg string) (string, error)

ResolveDeviceUDID returns the UDID of the device ResolveDevice picks.

func (*Resolver) ResolveGroupID

func (r *Resolver) ResolveGroupID(ctx context.Context, name string) (int64, error)

ResolveGroupID returns the ID for a user group given its name.

func (*Resolver) ResolveIBeaconID

func (r *Resolver) ResolveIBeaconID(ctx context.Context, name string) (int64, error)

ResolveIBeaconID returns the ID for an iBeacon given its name.

func (*Resolver) ResolveLocationID

func (r *Resolver) ResolveLocationID(ctx context.Context, name string) (int64, error)

ResolveLocationID returns the ID for a location given its name.

func (*Resolver) ResolveProfileID

func (r *Resolver) ResolveProfileID(ctx context.Context, name string) (int64, error)

ResolveProfileID returns the ID for a profile given its name.

func (*Resolver) ResolveUserID

func (r *Resolver) ResolveUserID(ctx context.Context, nameOrEmail string) (int64, error)

ResolveUserID returns the ID for a user given their username or email.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL