goladok3

package module
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 18 Imported by: 0

README

goladok3

Go Reference

Installation

go get github.com/masv3971/goladok3

Example

package main

import (
   "github.com/masv3971/goladok3"
)

func main() {
   

Documentation

Index

Constants

This section is empty.

Variables

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"
)
View Source
var PermissionID = map[int64]string{
	1008:   "examen.allt.las",
	11004:  "kataloginformation.las",
	21008:  "kataloginformationbehorighet.behorigheter.allt.las",
	21010:  "kataloginformationbehorighet.anvandare.las",
	31001:  "resultat.las",
	51001:  "studiedeltagande.las",
	51012:  "studiedeltagande.lasa_studieavgiftsbetalning_anmalningsavgiftsbetalning",
	51014:  "studiedeltagande.lasa_aktivitet_och_finansiering",
	51051:  "studiedeltagande.las.aktorer",
	51053:  "studiedeltagande.las.anknytning",
	51056:  "studiedeltagande.las.ej_hanterad_antagning",
	51058:  "studiedeltagande.las.dokumenteradebeslut",
	51060:  "studiedeltagande.las.grupper",
	51063:  "studiedeltagande.las.anteckning",
	51066:  "studiedeltagande.las.studiebehorigheter",
	51067:  "studiedeltagande.las.tillfallesantagningar",
	51070:  "studiedeltagande.kontrollera.mot.kurs",
	61001:  "studentinformation.lasa",
	61009:  "studentinformation.student.lasa",
	71001:  "utbildningsinformation.allman.las",
	90019:  "uppfoljning.feeds",
	91001:  "uppfoljning.allman.las",
	91011:  "uppfoljning.population.student.sok",
	91012:  "uppfoljning.population.student.addresslista",
	101030: "arendestod.las",
	860131: "extintegration.lasa",
}

PermissionID is a map of permissionID and permission

Functions

func Check added in v0.0.21

func Check(s interface{}) error

Check checks for validation error

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 added in v0.0.77

func NewOIDC(config OidcConfig) (*Client, error)

NewOIDC create a new OIDC instance of ladok

func NewX509 added in v0.0.77

func NewX509(config X509Config) (*Client, error)

NewX509 create a new x509 instance of ladok

func (*Client) CheckPermission added in v0.0.65

func (c *Client) CheckPermission(ctx context.Context, myPermissions Permissions) error

CheckPermission compare ladok permissions with ps

func (*Client) GetMyStudentDegrees added in v0.0.77

func (c *Client) GetMyStudentDegrees(ctx context.Context) (MyStudentDegrees, error)

GetMyStudentDegrees get student data.

func (*Client) IsStudent added in v0.0.77

func (c *Client) IsStudent(ctx context.Context, req *IsStudentReq) (bool, error)

IsStudent check if requested user is a student.

type FeedID added in v0.0.17

type FeedID string

FeedID ladok id is an int

type GetAktivPaLarosateReq added in v0.0.52

type GetAktivPaLarosateReq struct {
	UID string `validate:"required"`
}

GetAktivPaLarosateReq config for GetAktivPaLarosate

type GetBehorighetsprofilerReq added in v0.0.52

type GetBehorighetsprofilerReq struct {
	UID string `validate:"required"`
}

GetBehorighetsprofilerReq configuration for GetBehorighetsprofil

type GetStudentReq added in v0.0.21

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 added in v0.0.54

type GetTillfallesdeltagandePagaendeStudentReq struct {
	StudentUID string `validate:"required"`
}

GetTillfallesdeltagandePagaendeStudentReq request

type HistoricalReq added in v0.0.52

type HistoricalReq struct {
	ID int `validate:"required"`
}

HistoricalReq is config for Historical endpoint

type IsStudentReq added in v0.0.77

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 added in v0.0.77

type MyStudentDegrees []StudentDegree

MyStudentDegrees array of student degrees.

func (*MyStudentDegrees) MarshalPDF added in v0.0.77

func (degrees *MyStudentDegrees) MarshalPDF()

MarshalPDF marshal MyStudentDegrees to PDF.

type OidcConfig added in v0.0.77

type OidcConfig struct {
}

OidcConfig configures NewOIDC function

type Permissions added in v0.0.14

type Permissions map[int64]string

Permissions is a simplify permissions object

type StudentDegree added in v0.0.77

type StudentDegree struct {
	Name string `json:"name"`
}

StudentDegree is a student degree.

type X509Config added in v0.0.77

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

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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