Documentation
¶
Index ¶
Constants ¶
const InventoryTransactionKey contextKey = 0
InventoryTransactionKey is the context key for the inventory database transaction for a request
const SkywardTransactionKey contextKey = 1
SkywardTransactionKey is the context key for the skyward database transaction for a request
const UserKey contextKey = 2
UserKey is the context key for the user for a request
Variables ¶
var ChargeURLBase = "/charges/edit?type=id&search="
ChargeURLBase is the base URL used for charge links
var DeviceURLBase = "/edit?type=id&search="
DeviceURLBase is the base URL used for device links
Functions ¶
Types ¶
type AuthConfig ¶
AuthConfig holds configuration for connecting to an authentication source
type Charge ¶ added in v1.2.0
Charge represents an inventory charge
func (*Charge) AmountCharged ¶ added in v1.2.0
AmountCharged is the total amount charged
func (*Charge) Description ¶ added in v1.6.1
Description is a list of the reasons for the charge
type Issue ¶ added in v1.4.0
type Issue struct { Description string `json:"description,omitempty"` Link string `json:"link,omitempty"` LinkType LinkType `json:"link_type,omitempty"` LinkValue float32 `json:"link_value,omitempty"` LinkAdditional string `json:"link_additional,omitempty"` }
Issue represents an issue with a student
type Status ¶ added in v1.2.0
type Status struct { Type StatusType `json:"type"` Issues []*Issue `json:"issues,omitempty"` }
Status represents the status of a student
type StatusType ¶ added in v1.4.0
type StatusType string
StatusType is the type of Chromebook a student will receive
const ( StatusTypeNone StatusType = "none" StatusTypeRedBag StatusType = "red_bag" StatusTypeBlackBag StatusType = "black_bag" )
Status types
type Student ¶
type Student struct { FirstName string LastName string OtherID string Grade int T2E2Status *string EconomicallyDisadvantaged bool }
Student represents a Skyward Student
func GetStudent ¶ added in v1.2.0
GetStudent returns the Student with the given otherID
func GetStudentList ¶
GetStudentList returns a list of all Students
type User ¶
User represents an Active Directory User
func Authenticate ¶
func Authenticate(config *AuthConfig, username, password string) (*User, error)
Authenticate authenticates the given username and password against the given config, returning user information if successful, nil if unsuccessful, or an error if one occurred.