Documentation ¶
Index ¶
- Constants
- type AccessToken
- type Accts
- func (ac *Accts) GetAll() []AcctsItem
- func (ac *Accts) GetAllSortKey(id, sortKey string) []AcctsItem
- func (ac *Accts) GetState(id, sortKey string) *string
- func (ac *Accts) Init(ctx context.Context)
- func (ac *Accts) RemoveState(id, sortKey string) bool
- func (ac *Accts) SetState(id, sortKey, state string) bool
- type AcctsItem
- type ActiveLabItems
- type ActiveLabs
- func (ac *ActiveLabs) BatchDelete(ctx context.Context, id string, sortKeys []string) error
- func (ac *ActiveLabs) DeleteAll(ctx context.Context, id, sortKey string) error
- func (ac *ActiveLabs) DeleteParams(ctx context.Context, id, sortKey string, params []string) error
- func (ac *ActiveLabs) GetAll(ctx context.Context, id, expression string) []ActiveLabItems
- func (ac *ActiveLabs) GetAllIndex(ctx context.Context, sort_key string) []ActiveLabItems
- func (ac *ActiveLabs) GetAllSortKey(ctx context.Context, id, sortKey string) []ActiveLabItems
- func (ac *ActiveLabs) GetLaunch(id string) *Launch
- func (ac *ActiveLabs) GetParams(id, sortKey string) []string
- func (ac *ActiveLabs) Init(ctx context.Context)
- func (ac *ActiveLabs) SetLaunch(id string, launch Launch) error
- func (ac *ActiveLabs) SetParams(id, sortKey string, params []string) error
- func (ac *ActiveLabs) SetState(id, activeState string) error
- type AuthParams
- type CanvasConfig
- type ClassLabItem
- type Classes
- func (cl *Classes) Convert(labItem string) ClassLabItem
- func (cl *Classes) Get(ctx context.Context, id, sortKey string) []ClassLabItem
- func (cl *Classes) GetAll(ctx context.Context, id, sort_key string) []ClassLabItem
- func (cl *Classes) Init()
- func (cl *Classes) Set(ctx context.Context, id, sortKey string, labs []string) error
- type DomainConfig
- type LabItem
- type Labs
- type Launch
- type Oidc
- func (oi *Oidc) DeleteLtiAccessToken(scopesHash string) error
- func (oi *Oidc) DeleteLtiStateParams(state string) error
- func (oi *Oidc) GetLtiAccessToken(scopesHash string) (string, error)
- func (oi *Oidc) GetLtiConfigParameters(clientId string) (*CanvasConfig, error)
- func (oi *Oidc) GetLtiDomainConfigParameters(domain string) (*DomainConfig, error)
- func (oi *Oidc) GetLtiStateParams(state string) (*AuthParams, error)
- func (oi *Oidc) Init(ctx context.Context)
- func (oi *Oidc) IsRoleAdministrator(roles []string) bool
- func (oi *Oidc) IsRoleFaculty(roles []string) bool
- func (oi *Oidc) IsRoleInstructor(roles []string) bool
- func (oi *Oidc) IsRoleStudent(roles []string) bool
- func (oi *Oidc) SetLtiAccessToken(at *AccessToken) error
- func (oi *Oidc) SetLtiStateParams(state, nonce, clientId string) error
- type User
- type UserAssessment
- type UserLab
- type Users
- func (st *Users) Get(id, sortKey string) (*User, map[string]UserLab)
- func (st *Users) GetUserAssessment(id, labId, timestamp string) *UserAssessment
- func (st *Users) GetUserAssessments(id string) []UserAssessment
- func (st *Users) Init(ctx context.Context)
- func (st *Users) SetInitialAssessment(id, labId, timestamp string, questions map[string]string, ...) error
- func (st *Users) SetLabData(id, sort_key, labId string, userLabData UserLab) error
- func (st *Users) SetSnapshot(id, labId, timestamp, serviceName string, param *string) error
- func (st *Users) SetSubmission(id, labId, timestamp, ordinal, submission string) bool
- func (st *Users) UpdateAll(prs []types.WriteRequest)
Constants ¶
const ( LABS_DURATION_MIN = 5 // seconds LABS_DURATION_MAX = 14400 // seconds )
/////////////
const ( USER_STATUS_ACTIVE = "Active" USER_STATUS_INACTIVE = "Inactive" )
const ( NAME_LABS = "labs" NAME_ANSWERS = "qanswers" NAME_QUESTIONS = "qquestions" NAME_SUBMISSIONS = "qsubmissions" NAME_SNAPSHOTS = "snapshots" )
To aide in the setting/getting of the map data types in the table.
const ACCTS_AWS_ACCTS_GSI_NAME = "GSI"
const ACCTS_AWS_ACCTS_TABLE_NAME = "AwsAccts"
/////////////
const ACTIVE_LABS_GSI_NAME = "GSI"
const ACTIVE_LABS_TABLE_NAME = "ActiveLabs"
/////////////
const AdministratorRole = "http://purl.imsglobal.org/vocab/lis/v2/system/person#Administrator"
const CLASSES_TABLE_NAME = "Classes"
/////////////
const FacultyRole = "http://purl.imsglobal.org/vocab/lis/v2/institution/person#Faculty"
const InstructorRole = "http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor"
/////////////////
const LABS_TABLE_NAME = "Labs"
/////////////
const LTI_ACCESS_TOKEN_NAME = "LtiAccessToken"
const LTI_CONFIG_TABLE_NAME = "LtiConfig"
/////////////
const LTI_LAUNCH_TABLE_NAME = "LtiLaunch"
const LTI_STATE_TABLE_NAME = "LtiState"
const SORT_ID_LAUNCH = "SNF_LAUNCH"
const (
STATE_INUSE = "inuse"
)
/////////////
const StudentRole = "http://purl.imsglobal.org/vocab/lis/v2/institution/person#Student"
const TOKEN_DELTA = -60
///////////// The amount of time to subtract from the access token database ttl.
const USERS_GSI_NAME = "GSI"
const USERS_TABLE_NAME = "Users"
/////////////
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type Accts ¶
type Accts struct {
// contains filtered or unexported fields
}
func (*Accts) GetAll ¶
///////////////////// https://thomasstep.com/blog/using-dynamodb-with-golang#string-sets - StringSets
func (*Accts) GetAllSortKey ¶ added in v0.0.59
///////////////////// https://thomasstep.com/blog/using-dynamodb-with-golang#string-sets - StringSets
func (*Accts) Init ¶
///////////////////// https://dynobase.dev/dynamodb-golang-query-examples/
func (*Accts) RemoveState ¶ added in v0.0.33
/////////////////////
type AcctsItem ¶
type AcctsItem struct { Id string `dynamodbav:"id"` Alias string `dynamodbav:"alias"` Email string `dynamodbav:"email"` LastUsed int `dynamodbav:"last_used"` State *string `dynamodbav:"state,omitempty"` }
/////////////
type ActiveLabItems ¶
type ActiveLabItems struct {
Params []string `dynamodbav:"params"`
}
/////////////
type ActiveLabs ¶
type ActiveLabs struct {
// contains filtered or unexported fields
}
func (*ActiveLabs) BatchDelete ¶
////////////////////////////////////////
func (*ActiveLabs) DeleteAll ¶
func (ac *ActiveLabs) DeleteAll(ctx context.Context, id, sortKey string) error
////////////////////////////////////////
func (*ActiveLabs) DeleteParams ¶
////////////////////////////////////////
func (*ActiveLabs) GetAll ¶
func (ac *ActiveLabs) GetAll(ctx context.Context, id, expression string) []ActiveLabItems
////////////////////////////////////////
func (*ActiveLabs) GetAllIndex ¶
func (ac *ActiveLabs) GetAllIndex(ctx context.Context, sort_key string) []ActiveLabItems
////////////////////////////////////////
func (*ActiveLabs) GetAllSortKey ¶
func (ac *ActiveLabs) GetAllSortKey(ctx context.Context, id, sortKey string) []ActiveLabItems
////////////////////////////////////////
func (*ActiveLabs) GetLaunch ¶
func (ac *ActiveLabs) GetLaunch(id string) *Launch
////////////////////////////////////////
func (*ActiveLabs) GetParams ¶
func (ac *ActiveLabs) GetParams(id, sortKey string) []string
////////////////////////////////////////
func (*ActiveLabs) Init ¶
func (ac *ActiveLabs) Init(ctx context.Context)
///////////////////// https://dynobase.dev/dynamodb-golang-query-examples/
func (*ActiveLabs) SetParams ¶
func (ac *ActiveLabs) SetParams(id, sortKey string, params []string) error
///////////////////// https://thomasstep.com/blog/using-dynamodb-with-golang#string-sets - StringSets
func (*ActiveLabs) SetState ¶
func (ac *ActiveLabs) SetState(id, activeState string) error
///////////////////// https://thomasstep.com/blog/using-dynamodb-with-golang#string-sets - StringSets
type AuthParams ¶
type CanvasConfig ¶
type CanvasConfig struct { Platform string `dynamodbav:"platform"` AuthLoginUrl string `dynamodbav:"auth_login_url"` AuthTokenUrl string `dynamodbav:"auth_token_url"` DevelopmentIds []string `dynamodbav:"deployment_ids"` Domain string `dynamodbav:"domain"` TargetLinkUri string `dynamodbav:"target_link_uri"` KetSetUrl string `dynamodbav:"key_set_url"` }
'ClientId' is the key
type ClassLabItem ¶
type Classes ¶
type Classes struct {
// contains filtered or unexported fields
}
func (*Classes) Get ¶
func (cl *Classes) Get(ctx context.Context, id, sortKey string) []ClassLabItem
////////////////////////////////////////
func (*Classes) GetAll ¶
func (cl *Classes) GetAll(ctx context.Context, id, sort_key string) []ClassLabItem
////////////////////////////////////////
func (*Classes) Init ¶
func (cl *Classes) Init()
///////////////////// https://dynobase.dev/dynamodb-golang-query-examples/
type DomainConfig ¶ added in v0.0.5
type DomainConfig struct { Created string `dynamodbav:"created"` Enabled bool `dynamodbav:"enabled"` Platform string `dynamodbav:"platform"` Scopes []string `dynamodbav:"scopes"` Contact string `dynamodbav:"contact"` }
'Domain' is the key
type LabItem ¶
type LabItem struct { Id string `dynamodbav:"id"` Name string `dynamodbav:"name"` Desc string `dynamodbav:"desc"` Duration json.Number `dynamodbav:"duration"` QQuestions map[string]string `dynamodbav:"qquestions"` QAnswers map[string]string `dynamodbav:"qanswers"` }
/////////////
type Labs ¶
type Labs struct {
// contains filtered or unexported fields
}
func (*Labs) Init ¶
///////////////////// https://dynobase.dev/dynamodb-golang-query-examples/
type Launch ¶
type Launch struct { Id string `dynamodbav:"id" json:"id"` AwsAcctId string `dynamodbav:"aws_acct_id" json:"aws_acct_id"` // lower case that's how it is stored in the db. Timestamp string `dynamodbav:"timestamp" json:"timestamp"` ActiveState string `dynamodbav:"active_state" json:"active_state"` ExecutionArn string `dynamodbav:"execution_arn" json:"execution_arn"` LabId string `dynamodbav:"lab_id" json:"lab_id"` ClassId string `dynamodbav:"class_id" json:"class_id"` AttemptsRemaining int64 `dynamodbav:"attempts_remaining" json:"attempts_remaining"` Duration int64 `dynamodbav:"duration" json:"duration"` Roles []string `dynamodbav:"roles" json:"roles"` Services []string `dynamodbav:"services" json:"services"` Name string `dynamodbav:"name" json:"name"` Email string `dynamodbav:"email" json:"email"` }
Data acquired from both DynamoDb (dynamodbav) and cache (json).
type Oidc ¶
type Oidc struct {
// contains filtered or unexported fields
}
func (*Oidc) DeleteLtiAccessToken ¶
/////////////////////
func (*Oidc) DeleteLtiStateParams ¶ added in v0.0.8
/////////////////////
func (*Oidc) GetLtiAccessToken ¶
/////////////////////
func (*Oidc) GetLtiConfigParameters ¶ added in v0.0.3
func (oi *Oidc) GetLtiConfigParameters(clientId string) (*CanvasConfig, error)
////////////////////////////////////////
func (*Oidc) GetLtiDomainConfigParameters ¶ added in v0.0.6
func (oi *Oidc) GetLtiDomainConfigParameters(domain string) (*DomainConfig, error)
////////////////////////////////////////
func (*Oidc) GetLtiStateParams ¶ added in v0.0.3
func (oi *Oidc) GetLtiStateParams(state string) (*AuthParams, error)
/////////////////////
func (*Oidc) Init ¶
///////////////////// https://dynobase.dev/dynamodb-golang-query-examples/
func (*Oidc) IsRoleAdministrator ¶
////////////////////////
func (*Oidc) IsRoleFaculty ¶
////////////////////////
func (*Oidc) IsRoleInstructor ¶
////////////////////////
func (*Oidc) IsRoleStudent ¶
//////////////////////// https://www.imsglobal.org/spec/lti/v1p3#role-vocabularies
func (*Oidc) SetLtiAccessToken ¶
func (oi *Oidc) SetLtiAccessToken(at *AccessToken) error
/////////////////////
func (*Oidc) SetLtiStateParams ¶ added in v0.0.3
/////////////////////////////////////////////////////////////////////////
type UserAssessment ¶
type UserAssessment struct { Id string `dynamodbav:"id"` SortKey string `dynamodbav:"sort_key"` Snapshots map[string]string `dynamodbav:"snapshots"` QAnswers map[string]string `dynamodbav:"qanswers"` QQuestions map[string]string `dynamodbav:"qquestions"` QSubmissions map[string]string `dynamodbav:"qsubmissions"` }
////////
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
func (*Users) GetUserAssessment ¶
func (st *Users) GetUserAssessment(id, labId, timestamp string) *UserAssessment
////////////////////////////////////////
func (*Users) GetUserAssessments ¶
func (st *Users) GetUserAssessments(id string) []UserAssessment
////////////////////////////////////////
func (*Users) Init ¶
///////////////////// https://dynobase.dev/dynamodb-golang-query-examples/
func (*Users) SetInitialAssessment ¶
func (st *Users) SetInitialAssessment(id, labId, timestamp string, questions map[string]string, answers map[string]string) error
/////////////////////
func (*Users) SetLabData ¶ added in v0.0.25
/////////////////////
func (*Users) SetSnapshot ¶
/////////////////////
func (*Users) SetSubmission ¶
////////////////////////////////////////
func (*Users) UpdateAll ¶
func (st *Users) UpdateAll(prs []types.WriteRequest)
////////////////////////////////////////