models

package
v0.0.0-...-21eebf0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SessionsMap = map[string]*Session{}

SessionsMap holds the session. It is public so that we can save and restore them from the main.go

Functions

func LogIn

func LogIn(bcPath string, store sessions.Store, r *http.Request, w http.ResponseWriter) error

LogIn sets the bcPath and cfg static variables by loading the config

func SaveSession

func SaveSession(ID string, bcPath string, cfg *lib.Config)

SaveSession saved the session to the static map

Types

type Config

type Config struct {
	*TOMLConfig
	TaskManager helpers.TaskManagerI
	Executor    helpers.Executor
	CloudClient helpers.CloudClient
}

Config holds the global configuration of the server

func NewConfig

func NewConfig() (*Config, error)

NewConfig creates a new Config

type Session

type Session struct {
	BcPath string
	Cfg    *lib.Config
}

Session ...

func GetSession

func GetSession(store sessions.Store, r *http.Request) (*Session, error)

GetSession return the current session. An error can happen if we can't get the session. If the session is not created we return an empty session.

func (Session) Destroy

func (s Session) Destroy(store sessions.Store, r *http.Request,
	w http.ResponseWriter) error

Destroy removes the session from the maps and delets the config file

func (Session) GetAdminDarc

func (s Session) GetAdminDarc() string

GetAdminDarc ...

func (Session) GetByzCoinID

func (s Session) GetByzCoinID() string

GetByzCoinID ...

func (Session) GetIdentity

func (s Session) GetIdentity() string

GetIdentity ...

func (Session) GetRoster

func (s Session) GetRoster() string

GetRoster ...

func (Session) GetShortIdentity

func (s Session) GetShortIdentity() string

GetShortIdentity return the identity stored in the config in a short format

func (Session) IsLogged

func (s Session) IsLogged() bool

IsLogged tells if the credential have been set

func (*Session) PrepareAfterUnmarshal

func (s *Session) PrepareAfterUnmarshal() error

PrepareAfterUnmarshal should be called after loading a savec Session

func (*Session) PrepareBeforeMarshal

func (s *Session) PrepareBeforeMarshal()

PrepareBeforeMarshal should be called before the session is marshalled

type TOMLConfig

type TOMLConfig struct {
	ConfigPath string
	CatalogID  string
	LtsID      string
	LtsKey     string
	// Standalone mode means that the domanager will take responsibility itself
	// for making the Darc that controls access to the write instance for new
	// data sets. When Standalone is false (the default), domanager talks to the
	// Enclave manager to create the Darc.
	Standalone bool
}

TOMLConfig is a struct matching the configuration parameters that are stored in the 'config.toml' file.

Jump to

Keyboard shortcuts

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