Documentation ¶
Overview ¶
Config Session
Index ¶
- Constants
- func CreateCpHistEntry(cpName string, id string, user string, origin string, time int64) error
- func DebugGetCSDB() *db.DB
- func DeleteCpConfig(cpName string, user string) error
- func LoadCpHistEntries(fileName string)
- func SaveCpConfig(cpName string, user string) error
- func UpdateCpHistFile(user string) error
- type CpHistEntries
- type CpHistEntry
- type CsStatus
- type CsStatusAbortWarning
- type CsStatusCommitFailure
- type CsStatusCommitSuccess
- type CsStatusCommitWarning
- type CsStatusCreatedSession
- type CsStatusInternalError
- type CsStatusInvalidSession
- type CsStatusNotAllowed
- type CsStatusResumedSession
- type CsStatusSuccess
- type DSType
- type DataStore
- type ErrTag
- type GSOname
- type GSOstrict
- type GetSessionOpts
- type Session
- func (sess *Session) Abort() (bool, CsStatus)
- func (sess *Session) AbortTx(d *db.DB) error
- func (sess *Session) Commit(label string, timeout int, confirm bool) (bool, CsStatus)
- func (sess *Session) CommitTime() time.Time
- func (sess *Session) CommitTx(d *db.DB) error
- func (sess *Session) Exit() (bool, CsStatus)
- func (sess *Session) GetConfigDB(opts *db.Options) (*db.DB, bool, func(), error)
- func (sess *Session) GetState() string
- func (sess *Session) IsActive() bool
- func (sess *Session) IsConfigSession() bool
- func (sess *Session) IsPidActive() bool
- func (sess *Session) Kill(killActive bool, user string) CsStatus
- func (sess *Session) LastActiveTime() time.Time
- func (sess *Session) LastExitTime() time.Time
- func (sess *Session) LastResumeTime() time.Time
- func (sess *Session) Name() string
- func (sess *Session) SendMesg(mesg string, userName string) error
- func (cs *Session) SetCommitCh(ch chan<- bool)
- func (cs *Session) SetCommitState(state configSessionState)
- func (cs *Session) SetRollbackCfg(cfg string)
- func (cs *Session) StartCommitTimer(timeout int) *time.Timer
- func (sess *Session) StartOrResume(pid int32) (string, bool, CsStatus)
- func (sess *Session) StartTime() time.Time
- func (sess *Session) StartTx(d *db.DB, w []db.WatchKeys, tss []*db.TableSpec) error
- func (sess *Session) String() string
- func (sess *Session) TerminalPID() int32
- func (sess *Session) Token() string
- func (sess *Session) TxLen() int
- func (cs *Session) UpdateLastActiveTime()
- func (sess *Session) Username() string
Constants ¶
const MAX_HIST = 10
Variables ¶
This section is empty.
Functions ¶
func CreateCpHistEntry ¶
func DebugGetCSDB ¶
func DeleteCpConfig ¶
func LoadCpHistEntries ¶
func LoadCpHistEntries(fileName string)
func SaveCpConfig ¶
func UpdateCpHistFile ¶
Types ¶
type CpHistEntries ¶
type CpHistEntries struct {
CpHistEntries []CpHistEntry `json:"cphistentries"`
}
func (*CpHistEntries) AddCpHistEntry ¶
func (c *CpHistEntries) AddCpHistEntry(entry CpHistEntry)
func (*CpHistEntries) DeleteCpHistEntry ¶
func (c *CpHistEntries) DeleteCpHistEntry(entry CpHistEntry)
func (*CpHistEntries) DeleteFirstCpHistEntry ¶
func (c *CpHistEntries) DeleteFirstCpHistEntry()
type CpHistEntry ¶
type CsStatusAbortWarning ¶
type CsStatusAbortWarning struct {
UnlockFailure error // ConfigDB unlock failed
}
CsStatusAbortWarning indicates completion of CS Abort operation with warnings.
func (CsStatusAbortWarning) Status ¶
func (s CsStatusAbortWarning) Status() string
type CsStatusCommitFailure ¶
type CsStatusCommitFailure struct {
Err error
}
func (CsStatusCommitFailure) Error ¶
func (s CsStatusCommitFailure) Error() string
func (CsStatusCommitFailure) Status ¶
func (s CsStatusCommitFailure) Status() string
type CsStatusCommitSuccess ¶
type CsStatusCommitSuccess struct { }
func (CsStatusCommitSuccess) Status ¶
func (s CsStatusCommitSuccess) Status() string
type CsStatusCommitWarning ¶
type CsStatusCommitWarning struct { UnlockFailure error // ConfigDB unlock failed CheckpointFailure error // Checkpoint creation failed }
CsStatusCommitWarning indicates completion of CS Commit operation with warnings.
func (CsStatusCommitWarning) Status ¶
func (s CsStatusCommitWarning) Status() string
type CsStatusCreatedSession ¶
type CsStatusCreatedSession struct { }
func (CsStatusCreatedSession) Status ¶
func (s CsStatusCreatedSession) Status() string
type CsStatusInternalError ¶
type CsStatusInternalError struct {
Err error
}
func (CsStatusInternalError) Error ¶
func (s CsStatusInternalError) Error() string
func (CsStatusInternalError) Status ¶
func (s CsStatusInternalError) Status() string
type CsStatusInvalidSession ¶
type CsStatusInvalidSession struct {
Tag ErrTag
}
CsStatusInvalidSession indicates session lookup failures or bad state. ErrTag holds the actual cause.
func (CsStatusInvalidSession) Error ¶
func (s CsStatusInvalidSession) Error() string
func (CsStatusInvalidSession) Status ¶
func (s CsStatusInvalidSession) Status() string
type CsStatusNotAllowed ¶
type CsStatusNotAllowed struct { }
CsStatusNotAllowed indicates user authorization error
func (CsStatusNotAllowed) Error ¶
func (s CsStatusNotAllowed) Error() string
func (CsStatusNotAllowed) Status ¶
func (s CsStatusNotAllowed) Status() string
type CsStatusResumedSession ¶
type CsStatusResumedSession struct { }
func (CsStatusResumedSession) Status ¶
func (s CsStatusResumedSession) Status() string
type CsStatusSuccess ¶
type CsStatusSuccess struct { }
func (CsStatusSuccess) Status ¶
func (s CsStatusSuccess) Status() string
type ErrTag ¶
type ErrTag string
const ( ErrTagNameNotFound ErrTag = "cs-name-not-found" // Lookup by name failed ErrTagTokenNotFound ErrTag = "cs-token-not-found" // Lookup by token failed ErrTagInvalidUser ErrTag = "cs-invalid-user" // CS owned by someone else ErrTagInvalidTerminal ErrTag = "cs-invalid-term" // CS active on different terminal ErrTagActive ErrTag = "cs-active" // Op not allowed on active CS ErrTagNotActive ErrTag = "cs-inactive" // Op not allowed on suspended CS ErrTagInvalidState ErrTag = "cs-invalid-state" // Op not allowed in current CS state ErrTagUnknown ErrTag = "cs-unknown" // Any unexpected CS context (mostly code error) )
type GSOstrict ¶
type GSOstrict struct { }
GSOstrict option requires session pid and username to match.
type GetSessionOpts ¶
type GetSessionOpts interface { }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func GetAllSessions ¶
GetAllSessions returns all session info from cache
func GetSession ¶
func (*Session) CommitTime ¶
CommitTime returns session commit timestamp
func (*Session) GetConfigDB ¶
func (*Session) IsConfigSession ¶
func (*Session) IsPidActive ¶
func (*Session) LastActiveTime ¶
LastActiveTime returns timestamp of last activity on this session
func (*Session) LastExitTime ¶
LastExitTime returns timestamp of last successful session exit event
func (*Session) LastResumeTime ¶
LastResumeTime returns timestamp of last successful session resume event
func (*Session) SetCommitCh ¶
func (cs *Session) SetCommitCh(ch chan<- bool)
func (*Session) SetCommitState ¶
func (cs *Session) SetCommitState(state configSessionState)
func (*Session) SetRollbackCfg ¶
func (cs *Session) SetRollbackCfg(cfg string)
func (*Session) StartCommitTimer ¶
func (*Session) StartOrResume ¶
func (*Session) TerminalPID ¶
TerminalPID returns the active CLI terminal's pid; 0 if inactive
func (*Session) UpdateLastActiveTime ¶
func (cs *Session) UpdateLastActiveTime()