goladok3

package module
v0.0.79 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

goladok3

Go Reference

Installation

go get github.com/SUNET/goladok3

Example

package main

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

func main() {
   

Documentation

Index

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

func Check

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

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.

func (*Client) IsStudent

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

IsStudent check if requested user is a student.

type FeedID

type FeedID string

FeedID ladok id is an int

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 OidcConfig

type OidcConfig struct {
}

OidcConfig configures NewOIDC function

type Permissions

type Permissions map[int64]string

Permissions is a simplify permissions object

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

Directories

Path Synopsis
examples
simple command

Jump to

Keyboard shortcuts

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