node

package
v0.0.0-...-7f33b96 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearSessions

func ClearSessions(sessions []*iModels.Session)

ClearSessions removes the session from tmp store and removes the link

Types

type AppNode

type AppNode struct {
	Router             *mux.Router
	Config             *infrastructure.NodeConfig
	Ctx                context.Context
	Sessions           []*iModels.Session
	HTTPClient         *http.Client
	KeycloakClient     gocloak.GoCloak
	KeycloakToken      *gocloak.JWT
	KeycloakTokenCache map[string]*gocloak.RetrospecTokenResult
}

AppNode struct to maintain router

func (*AppNode) AddSession

func (n *AppNode) AddSession(username string, token string) (int, string)

AddSession appends a new user session to the node (verfies that session is valid) - Will override session if already exist

0 -> ok || 1 -> username is empty || 2 -> token ist empty

func (*AppNode) Initialize

func (n *AppNode) Initialize(config infrastructure.NodeConfig)

Initialize initializes application related content - router initialization

func (*AppNode) Run

func (n *AppNode) Run(addr string)

Run starts the application on the passed address with the inherited router WARN: router must be initialized first

Jump to

Keyboard shortcuts

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