Documentation
¶
Index ¶
- Variables
- func Check(s interface{}) error
- type Client
- type FeedID
- type GetAktivPaLarosateReq
- type GetBehorighetsprofilerReq
- type GetStudentReq
- type GetTillfallesdeltagandePagaendeStudentReq
- type HistoricalReq
- type IsStudentReq
- type MyStudentDegrees
- type OidcConfig
- type Permissions
- type StudentDegree
- type X509Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRequest = errors.New("Invalid request") ErrNotAllowedRequest = errors.New("Not allowed request") )
View Source
var ( // ContentTypeStudiedeltagandeJSON server response content type ContentTypeStudiedeltagandeJSON = "application/vnd.ladok-studiedeltagande+json;charset=UTF-8" // ContentTypeKataloginformationJSON server response content type ContentTypeKataloginformationJSON = "application/vnd.ladok-kataloginformation+json;charset=UTF-8" // ContentTypeStudentinformationJSON server response content type ContentTypeStudentinformationJSON = "application/vnd.ladok-studentinformation+json;charset=UTF-8" // ContentTypeAtomXML server response content type ContentTypeAtomXML = "application/atom+xml;charset=UTF-8" // TypeStudentinformation type TypeStudentinformation = "studentinformation" )
Functions ¶
Types ¶
type Client ¶
type Client struct {
HTTPClient *http.Client
Kataloginformation *kataloginformationService
Studentinformation *studentinformationService
Studentdeltagande *studentdeltagandeService
Feed *feedService
// contains filtered or unexported fields
}
Client holds the ladok object
func NewOIDC ¶
func NewOIDC(config OidcConfig) (*Client, error)
NewOIDC create a new OIDC instance of ladok
func NewX509 ¶
func NewX509(config X509Config) (*Client, error)
NewX509 create a new x509 instance of ladok
func (*Client) GetMyStudentDegrees ¶
func (c *Client) GetMyStudentDegrees(ctx context.Context) (MyStudentDegrees, error)
GetMyStudentDegrees get student data.
type GetAktivPaLarosateReq ¶
type GetAktivPaLarosateReq struct {
UID string `validate:"required"`
}
GetAktivPaLarosateReq config for GetAktivPaLarosate
type GetBehorighetsprofilerReq ¶
type GetBehorighetsprofilerReq struct {
UID string `validate:"required"`
}
GetBehorighetsprofilerReq configuration for GetBehorighetsprofil
type GetStudentReq ¶
type GetStudentReq struct {
UID string `validate:"required_without_all=Personnummer ExterntUID"`
ExterntUID string `validate:"required_without_all=Personnummer UID"`
Personnummer string `validate:"required_without_all=UID ExterntUID"`
}
GetStudentReq config for GetStudent
type GetTillfallesdeltagandePagaendeStudentReq ¶
type GetTillfallesdeltagandePagaendeStudentReq struct {
StudentUID string `validate:"required"`
}
GetTillfallesdeltagandePagaendeStudentReq request
type HistoricalReq ¶
type HistoricalReq struct {
ID int `validate:"required"`
}
HistoricalReq is config for Historical endpoint
type IsStudentReq ¶
type IsStudentReq struct {
UID string `validate:"required_without_all=Personnummer ExterntUID"`
ExterntUID string `validate:"required_without_all=Personnummer UID"`
Personnummer string `validate:"required_without_all=UID ExterntUID"`
}
IsStudentReq is a request to check if a user is a student.
type MyStudentDegrees ¶
type MyStudentDegrees []StudentDegree
MyStudentDegrees array of student degrees.
func (*MyStudentDegrees) MarshalPDF ¶
func (degrees *MyStudentDegrees) MarshalPDF()
MarshalPDF marshal MyStudentDegrees to PDF.
type StudentDegree ¶
type StudentDegree struct {
Name string `json:"name"`
}
StudentDegree is a student degree.
type X509Config ¶
type X509Config struct {
URL string `validate:"required"`
Certificate *x509.Certificate `validate:"required"`
CertificatePEM []byte `validate:"required"`
//PrivateKey *rsa.PrivateKey `validate:"required"`
PrivateKeyPEM []byte `validate:"required"`
ProxyURL string
}
X509Config configures new function
Source Files
¶
Click to show internal directories.
Click to hide internal directories.