stineapi

package
v1.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Client    *http.Client // Client is an HTTP client, which is authenticated on STiNE, if Login was successful
	SessionNo string       // Identifier for the current session provided by STiNE, could be unique, empty string prior to successful Login
}

Session represent a STiNE session. Think of it like an isolated tab with STiNE open.

func NewSession

func NewSession() Session

NewSession creates a new Session and returns it.

func (*Session) GetCategories

func (session *Session) GetCategories(depth int) (moduleGetter.Category, error)

GetCategories returns the moduleGetter.Category with modules and nested categories the user can register for.

The depth indicates how deep different categories are nested within a category - starting at 0, which returns the initial page.

func (*Session) Login

func (session *Session) Login(username string, password string) error

Login authenticates a session on the STiNE website. If no error is returned, the user is logged in.

func (*Session) RegisterForModule

func (session *Session) RegisterForModule(module moduleGetter.Module) *moduleRegisterer.ModuleRegistration

RegisterForModule registers the current authenticated user for the passed moduleGetter.Module. A moduleRegisterer.ModuleRegistration will be returned, which provides various functions for the registration.

Directories

Path Synopsis
internal
tan

Jump to

Keyboard shortcuts

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