Documentation
¶
Index ¶
- func LoadConfigurations(environment utils.Environment, applicationBuilder *models.ApplicationBuilder) (*models.RootConfiguration, []*models.Application)
- func UnmarshalConfiguration(file string, applicationBuilder *models.ApplicationBuilder) (models.RootConfiguration, error)
- type Application
- type Database
- type DatabaseImpl
- type Instance
- type Session
- func (s *Session) Add(session *models.Session)
- func (s *Session) AddSessionToCategory(category SessionCategory, session *models.Session)
- func (s *Session) AliveByApplicationCount(application *models.Application) int
- func (s *Session) Delete(session *models.Session)
- func (s *Session) GetAliveApplicationSessionByCheckout(checkout string, application *models.Application) *models.Session
- func (s *Session) GetAllAliveSessions() []*models.Session
- func (s *Session) GetApplicationSessionsByCategory(category SessionCategory) []*models.Session
- func (s *Session) GetByApplicationName(app string) []*models.Session
- func (s *Session) GetByUUID(uuid string) *models.Session
- func (s *Session) LoadSessions(application *Application, sessionBuilder *models.SessionBuilder)
- func (s *Session) Update(session *models.Session)
- type SessionCategory
- type SessionsByCategory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfigurations ¶
func LoadConfigurations(environment utils.Environment, applicationBuilder *models.ApplicationBuilder) (*models.RootConfiguration, []*models.Application)
func UnmarshalConfiguration ¶
func UnmarshalConfiguration(file string, applicationBuilder *models.ApplicationBuilder) (models.RootConfiguration, error)
Types ¶
type Application ¶
Application is the application storage. Contains methods to access and store applications
func NewApplication ¶
func NewApplication(environment utils.Environment) *Application
NewApplication builds new application storage
func (*Application) Add ¶
func (a *Application) Add(application *models.Application)
Add stores an application
func (*Application) Get ¶
func (a *Application) Get(name string) *models.Application
Get retrieves an application by its name. If name is an empty string, the "default" application is returned
func (*Application) GetAll ¶
func (a *Application) GetAll() []*models.Application
GetAll retrieves all applications
type DatabaseImpl ¶
type DatabaseImpl struct {
// contains filtered or unexported fields
}
func NewDB ¶
func NewDB(folder string) *DatabaseImpl
func (*DatabaseImpl) GetDB ¶
func (d *DatabaseImpl) GetDB() *badger.DB
type Instance ¶
type Instance struct {
Host string
}
func DetectInstance ¶
func DetectInstance(environment utils.Environment) (*Instance, error)
func NewInstance ¶
func (*Instance) Persist ¶
func (i *Instance) Persist(environment utils.Environment)
type Session ¶
Session is the session storage. Contains methods to access and store sessions into the database
func NewSession ¶
func NewSession(db Database, mutexBuilder utils.MutexBuilder) *Session
NewSession creates new database storage
func (*Session) AddSessionToCategory ¶
func (s *Session) AddSessionToCategory(category SessionCategory, session *models.Session)
func (*Session) AliveByApplicationCount ¶
func (s *Session) AliveByApplicationCount(application *models.Application) int
AliveByApplicationCount retrieves the number of sessions of an application
func (*Session) GetAliveApplicationSessionByCheckout ¶
func (s *Session) GetAliveApplicationSessionByCheckout(checkout string, application *models.Application) *models.Session
GetAliveApplicationSessionByCheckout retrieves a single session identified by its status (which must be "alvie") and by its checkout
func (*Session) GetAllAliveSessions ¶
GetAllAliveSessions retrieves a slice of sessions whose status is "alive". A session is "alive" if it can or is about to ready for being used
func (*Session) GetApplicationSessionsByCategory ¶
func (s *Session) GetApplicationSessionsByCategory(category SessionCategory) []*models.Session
func (*Session) GetByApplicationName ¶
GetByApplicationName retrieves a slice of sessions given their app name
func (*Session) LoadSessions ¶
func (s *Session) LoadSessions(application *Application, sessionBuilder *models.SessionBuilder)
LoadSessions given an application, restores its sessions retrieving them from the database
type SessionCategory ¶
type SessionCategory string
const (
SessionCategoryFailedToStart SessionCategory = "failed_to_start"
)
type SessionsByCategory ¶
type SessionsByCategory struct { utils.RWLocker Data map[SessionCategory][]*models.Session }