Versions in this module Expand all Collapse all v0 v0.9.1 Mar 25, 2025 v0.9.0 Mar 25, 2025 Changes in this version + const LOGGER_SECURITYRECORD + const TYPEMANAGER_CONNADAPTERS + var ErrDatabaseIsEmpty = errors.New("database is empty") + var ErrHostIsEmpty = errors.New("host is empty") + var ErrNoPK = fmt.Errorf("no primary key") + var ErrPasswordIsEmpty = errors.New("password is empty") + var ErrUsernameIsEmpty = errors.New("username is empty") + func LogSecurityRecord(sec RecordSecurity) error + func LogSecurityRecordWithOptions(sec RecordSecurity, doValidate bool) error + type ADBAdapterBase struct + Database string + Password string + PasswordFile string + Username string + func (cn *ADBAdapterBase) GetDatabase() string + func (cn *ADBAdapterBase) GetPassword() string + func (cn *ADBAdapterBase) GetUsername() string + func (cn *ADBAdapterBase) Test() (bool, TestStatus, error) + func (cn *ADBAdapterBase) Validate() error + type Adapter struct + Host string + Name AdapterName + Port int + Type AdapterType + func (a *Adapter) GetHost() string + func (a *Adapter) GetName() AdapterName + func (a *Adapter) GetPort() int + func (a *Adapter) GetType() AdapterType + func (a *Adapter) Test() (bool, TestStatus, error) + func (a *Adapter) Validate() error + type AdapterName string + func (an AdapterName) IsEmpty() bool + func (an AdapterName) Matches(s string) bool + func (an AdapterName) String() string + func (an AdapterName) TrimSpace() AdapterName + type AdapterNames []AdapterName + func (ans AdapterNames) Find(an AdapterName) AdapterName + func (ans AdapterNames) HasKey(s AdapterName) bool + func (ans AdapterNames) IsEmpty() bool + func (ans AdapterNames) Matches(s string) bool + func (ans AdapterNames) String() string + func (ans AdapterNames) ToStringArray() []string + type AdapterType string + func (at AdapterType) IsEmpty() bool + func (at AdapterType) Matches(s string) bool + func (at AdapterType) String() string + func (at AdapterType) ToStringTrimLower() string + func (at AdapterType) TrimSpace() AdapterType + func (at AdapterType) Validate() error + type AdapterTypes []AdapterType + func (ats AdapterTypes) Find(at AdapterType) AdapterType + func (ats AdapterTypes) HasKey(s AdapterType) bool + func (ats AdapterTypes) IsEmpty() bool + func (ats AdapterTypes) Matches(s string) bool + func (ats AdapterTypes) String() string + func (ats AdapterTypes) ToStringArray() []string + type Conn struct + Adapter IAdapter + Description string + Id ConnId + Ignore bool + IsBootstrap bool + IsRequired bool + func (c *Conn) DoIgnore() bool + func (c *Conn) GetAdapter() IAdapter + func (c *Conn) GetId() ConnId + func (c *Conn) GetIsBootstrap() bool + func (c *Conn) GetIsRequired() bool + func (c *Conn) Test() (bool, TestStatus, error) + func (c *Conn) TestBootstrap() (bool, TestStatus, error) + func (c *Conn) TestRequired() (bool, TestStatus, error) + func (c *Conn) UnmarshalJSON(data []byte) error + func (c *Conn) Validate() error + type ConnActionMap map[ConnActionType]*ConnSystemItem + func NewConnActionMap() ConnActionMap + func (cvm ConnActionMap) GetItem(cvType ConnActionType) *ConnSystemItem + func (cvm ConnActionMap) HasSqlText(cvType ConnActionType) bool + func (cvm ConnActionMap) MustGetItem(cvType ConnActionType) *ConnSystemItem + func (cvm ConnActionMap) Validate() error + type ConnActionType string + const CONNACTIONTYPE_CREATE + const CONNACTIONTYPE_DELETE + const CONNACTIONTYPE_DOWNGRADE + const CONNACTIONTYPE_NOOP_EQUAL + const CONNACTIONTYPE_UPGRADE + func (csa ConnActionType) IsEmpty() bool + func (csa ConnActionType) Matches(s string) bool + func (csa ConnActionType) String() string + func (csa ConnActionType) ToStringTrimLower() string + func (csa ConnActionType) TrimSpace() ConnActionType + func (csa ConnActionType) Validate() error + type ConnActionTypes []ConnActionType + func (csas ConnActionTypes) Find(csa ConnActionType) ConnActionType + func (csas ConnActionTypes) HasKey(s ConnActionType) bool + func (csas ConnActionTypes) IsEmpty() bool + func (csas ConnActionTypes) Matches(s string) bool + func (csas ConnActionTypes) String() string + func (csas ConnActionTypes) ToStringArray() []string + type ConnId struct + func NewConnId() ConnId + func ParseConnId(target string) ConnId + func ToConnIdFromUUID(id uuid.UUID) ConnId + func (sid *ConnId) FromString(input string) error + func (sid *ConnId) UnmarshalJSON(data []byte) error + func (sid *ConnId) UnmarshalText(text []byte) error + func (sid ConnId) HasMatch(target ConnId) bool + func (sid ConnId) IsNil() bool + func (sid ConnId) MarshalJSON() ([]byte, error) + func (sid ConnId) MarshalText() ([]byte, error) + func (sid ConnId) MatchesOne(targets ...ConnId) bool + func (sid ConnId) String() string + type ConnIds []ConnId + func (sids ConnIds) Append(id ConnId, allowDuplicates bool) ConnIds + func (sids ConnIds) Clean() ConnIds + func (sids ConnIds) Contains(sid ConnId) bool + func (sids ConnIds) Filter(predicate func(ConnId) bool) ConnIds + func (sids ConnIds) IsValid(targets ...ConnId) bool + func (sids ConnIds) Merge(other ConnIds) ConnIds + func (sids ConnIds) Remove(target ConnId) ConnIds + type ConnSystemHelper struct + Action ConnActionType + ActionMap ConnActionMap + FromVersion *semver.Version + ToVersion *semver.Version + func (sb *ConnSystemHelper) GetAction() ConnActionType + func (sb *ConnSystemHelper) GetFromVersion() semver.Version + func (sb *ConnSystemHelper) GetMap() ConnActionMap + func (sb *ConnSystemHelper) GetToVersion() semver.Version + func (sb *ConnSystemHelper) HasFromVersion() bool + func (sb *ConnSystemHelper) HasToVersion() bool + func (sb *ConnSystemHelper) IsCreate() bool + func (sb *ConnSystemHelper) IsDelete() bool + func (sb *ConnSystemHelper) IsDowngrade() bool + func (sb *ConnSystemHelper) IsUpgrade() bool + func (sb *ConnSystemHelper) MustGet(action ConnActionType) string + func (sb *ConnSystemHelper) MustGetByAction() string + func (sb *ConnSystemHelper) MustGetCreate() string + func (sb *ConnSystemHelper) MustGetDelete() string + func (sb *ConnSystemHelper) MustGetDowngrade() string + func (sb *ConnSystemHelper) MustGetUpgrade() string + type ConnSystemItem struct + DoSkip bool + Text string + func (cvi *ConnSystemItem) UnpackImportWithMacroDirective(dirOptions string) error + func (cvi *ConnSystemItem) Validate() error + type DbColumnName string + func (cn DbColumnName) Bytes() []byte + func (cn DbColumnName) IsEmpty() bool + func (cn DbColumnName) String() string + func (cn DbColumnName) TrimSpace() DbColumnName + type DbColumnNames []DbColumnName + func NewDbColumnNames(names ...DbColumnName) DbColumnNames + func (cns DbColumnNames) Add(names ...DbColumnName) DbColumnNames + func (cns DbColumnNames) Ensure(names ...DbColumnName) DbColumnNames + func (cns DbColumnNames) Find(name DbColumnName) DbColumnName + func (cns DbColumnNames) Has(name DbColumnName) bool + func (cns DbColumnNames) Length() int + func (cns DbColumnNames) Remove(names ...DbColumnName) DbColumnNames + type IAdapter interface + GetHost func() string + GetName func() AdapterName + GetPort func() int + GetType func() AdapterType + Test func() (ok bool, testStatus TestStatus, err error) + Validate func() error + type IAdapterDB interface + GetDatabase func() string + GetPassword func() string + GetUsername func() string + Test func() (bool, TestStatus, error) + Validate func() error + type IAdapterMap map[AdapterName]IAdapter + func (m IAdapterMap) Get(name AdapterName) (IAdapter, bool) + func (m IAdapterMap) Remove(name AdapterName) + func (m IAdapterMap) Set(name AdapterName, adapter IAdapter) + func (m IAdapterMap) ToArray() IAdapters + type IAdapters []IAdapter + func (adapters IAdapters) ToMap() IAdapterMap + type IConn interface + DoIgnore func() bool + GetAdapter func() IAdapter + GetId func() ConnId + GetIsBootstrap func() bool + GetIsRequired func() bool + Validate func() error + type IConnMap map[ConnId]IConn + func (m IConnMap) Get(id ConnId) (IConn, bool) + func (m IConnMap) Remove(id ConnId) + func (m IConnMap) Set(id ConnId, conn IConn) + func (m IConnMap) ToAdapterArray() IAdapters + func (m IConnMap) ToAdapterMap() IAdapterMap + func (m IConnMap) ToArray() IConns + type IConns []IConn + func (conns *IConns) Remove(id ConnId) + func (conns *IConns) Set(conn IConn) + func (conns *IConns) UnmarshalJSON(data []byte) error + func (conns IConns) FindByAdapterName(name AdapterName) (IAdapter, bool) + func (conns IConns) FindByConnId(id ConnId) (IConn, bool) + func (conns IConns) FindConnByAdapterName(name AdapterName) (IConn, bool) + func (conns IConns) Get(id ConnId) (IConn, bool) + func (conns IConns) GetConnCounts() (cTotal int, cIgnore int, cBootstrap int, cIsRequired int) + func (conns IConns) ToAdapterArray() IAdapters + func (conns IConns) ToAdapterMap() IAdapterMap + func (conns IConns) ToMap() IConnMap + type IImportRecordWrapper interface + GetDirImports func() string + GetModifiedDate func() time.Time + GetRecImportOnExistsType func() RecImportOnExistsType + GetTag func(key atags.TagKey) *atags.TagKeyValueString + type IRecordAction interface + Import func(ri *RI, irw IImportRecordWrapper) (ImportRecordResults, error) + type IRecordModel interface + GetPrimaryKeyAsString func() string + GetRecordSecurity func() RecordSecurity + Insert func(ri *RI) error + Select func(ri *RI) error + SelectIntoNewObject func(ri *RI) (IRecordModel, error) + Update func(ri *RI) error + Upsert func(ri *RI) error + type ISBAdapter interface + GetHost func() string + GetName func() AdapterName + GetType func() AdapterType + type ISBAdapterHelper interface + CheckVersionState func() ConnActionType + GetFromVersion func() semver.Version + GetMap func() ConnSystemHelper + GetToVersion func() semver.Version + HasFromVersion func() bool + HasToVersion func() bool + IsCreate func() bool + IsDelete func() bool + IsDowngrade func() bool + IsUpgrade func() bool + MustGet func(action ConnActionType) string + MustGetByAction func() string + MustGetCreate func() string + MustGetDelete func() string + MustGetDowngrade func() string + MustGetUpgrade func() string + type ISBAdapterSql interface + Query func(query string) (ISBAdapterSqlRows, error) + QueryArgs func(query string, args ...interface{}) (ISBAdapterSqlRows, error) + QueryModel func(query string, model interface{}) error + QueryModelArgs func(query string, model interface{}, args ...interface{}) error + SupportsModels func() bool + type ISBAdapterSqlMap interface + GetAdapterHelper func() ISBAdapterHelper + RunCommand func(text string) error + RunMapAction func(action ConnActionType) error + RunMapByAction func() error + type ISBAdapterSqlRows interface + Close func() error + EndTimer func() time.Duration + GetTimerDuration func() time.Duration + Next func() bool + Scan func(dest ...any) error + StartTimer func() + type ImportRecordResult struct + Error error + Id string + ImportedDate time.Time + type ImportRecordResults []*ImportRecordResult + func NewImportRecordResults(id string, err error) ImportRecordResults + type Manager struct + Conns IConns + LimitAccess bool + func NewManager() *Manager + func (m *Manager) FindAdapter(name AdapterName) IAdapter + func (m *Manager) FindConn(id ConnId) IConn + func (m *Manager) HasConns() bool + func (m *Manager) Test(failQuiet bool) error + func (m *Manager) Validate() error + func (m *Manager) ValidateBootstrap() error + func (m *Manager) ValidateRequired() error + func (m *Manager) ValidateWithOptions(checkIsBootstrap bool, checkIsRequired bool) error + type RI struct + AdapterName AdapterName + ConnId ConnId + Event string + User auser.RecordUserIdentity + func NewRI(connId ConnId) *RI + func NewRIAdapter(adapterName AdapterName) *RI + func NewRISEC(connId ConnId, user auser.RecordUserIdentity) *RI + func NewRISECAdapter(adapterName AdapterName, user auser.RecordUserIdentity) *RI + func NewRIWithOptions(connId ConnId, adapterName AdapterName, user auser.RecordUserIdentity, ...) *RI + func (ri *RI) GetAdapterName() AdapterName + func (ri *RI) GetConnId() ConnId + func (ri *RI) GetEvent() string + func (ri *RI) GetRecordSecurity(action RecordActionType, target *RecordSecurity) (*RecordSecurity, error) + func (ri *RI) GetUser() auser.RecordUserIdentity + func (ri *RI) NewRI() *RI + func (ri *RI) NewRISEC() *RI + func (ri *RI) NewRISECUser(user auser.RecordUserIdentity) *RI + func (ri *RI) SetNoApplyHistory(noApplyHistory bool) + func (ri *RI) SetRecordSecurity(sec *RecordSecurity) + type RecImportOnExistsType int + const REC_IMPORT_ON_EXISTS_IGNORE + const REC_IMPORT_ON_EXISTS_UPDATE + const REC_IMPORT_ON_EXISTS_UPDATE_IF_NEWER + type RecordActionType string + const REC_ACTION_DELETE + const REC_ACTION_INSERT + const REC_ACTION_UPDATE + const REC_ACTION_UPSERT + const REC_EVENT_ADMINFIX + const REC_EVENT_IMPORT + func (rt RecordActionType) IsEmpty() bool + func (rt RecordActionType) String() string + func (rt RecordActionType) TrimSpace() RecordActionType + type RecordIdentifierMeta struct + Id string + Type RecordIdentifierType + func NewRecordIdentifierMeta(recIdType RecordIdentifierType, id string) *RecordIdentifierMeta + func (rid *RecordIdentifierMeta) HasMatch(other *RecordIdentifierMeta) bool + func (rid *RecordIdentifierMeta) HasMatchWithTypeId(recIdType RecordIdentifierType, id string) bool + func (rid *RecordIdentifierMeta) Validate() error + type RecordIdentifierMetas []*RecordIdentifierMeta + func (rids RecordIdentifierMetas) Filter(predicate func(label *RecordIdentifierMeta) bool) RecordIdentifierMetas + func (rids RecordIdentifierMetas) FindById(id string) *RecordIdentifierMeta + func (rids RecordIdentifierMetas) FindByType(recIdType RecordIdentifierType) *RecordIdentifierMeta + func (rids RecordIdentifierMetas) FindByTypeAndId(recIdType RecordIdentifierType, id string) *RecordIdentifierMeta + func (rids RecordIdentifierMetas) FindExactMatch(target *RecordIdentifierMeta) *RecordIdentifierMeta + func (rids RecordIdentifierMetas) FindWithMatchingOptions(target *RecordIdentifierMeta, matchByType bool, matchById bool) *RecordIdentifierMeta + func (rids RecordIdentifierMetas) HasExactMatch(target *RecordIdentifierMeta) bool + func (rids RecordIdentifierMetas) HasMatch(targets ...*RecordIdentifierMeta) bool + func (rids RecordIdentifierMetas) HasMatchByTypeId(recIdType RecordIdentifierType, id string) bool + func (rids RecordIdentifierMetas) HasMatchByTypeIdByType(recIdType RecordIdentifierType, id string) bool + func (rids RecordIdentifierMetas) HasMatchByTypeOnly(recIdType RecordIdentifierType) bool + func (rids RecordIdentifierMetas) HasMatchWithOptions(target *RecordIdentifierMeta, matchByLabel bool) bool + func (rids RecordIdentifierMetas) RemoveById(id string) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) RemoveByType(recIdType RecordIdentifierType) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) RemoveByTypeAndId(recIdType RecordIdentifierType, id string) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) RemoveExact(target *RecordIdentifierMeta) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) RemoveWithOptions(target *RecordIdentifierMeta, matchByType bool, matchById bool) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) Set(target *RecordIdentifierMeta) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) SetById(id string) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) SetByType(target *RecordIdentifierMeta) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) SetByTypeAndId(recIdType RecordIdentifierType, id string) (RecordIdentifierMetas, error) + func (rids RecordIdentifierMetas) SetWithOptions(target *RecordIdentifierMeta, matchByType bool, matchById bool) (RecordIdentifierMetas, error) + type RecordIdentifierType string + const REC_ID_EMAIL + const REC_ID_PHONE + const REC_ID_USER + func (rt RecordIdentifierType) IsEmpty() bool + func (rt RecordIdentifierType) IsValid() bool + func (rt RecordIdentifierType) String() string + func (rt RecordIdentifierType) TrimSpace() RecordIdentifierType + type RecordIdentifierTypes []RecordIdentifierType + func RECIDENTIFIERS() RecordIdentifierTypes + func (rts RecordIdentifierTypes) HasMatch(recIdType RecordIdentifierType) bool + type RecordSecurity struct + Action RecordActionType + Error *aerr.Error + Event string + History RecordSecurityHistoryTimes + Meta json.RawMessage + RecIds atags.TagArrStrings + Time time.Time + User auser.RecordUserIdentity + func NewRecordSecurity(user auser.RecordUserIdentity, action RecordActionType, event string) *RecordSecurity + func (rs *RecordSecurity) EnsureEventDefaults(cols DbColumnNames) + func (rs *RecordSecurity) IsValid() error + func (rs *RecordSecurity) UpdateFrom(target *RecordSecurity) error + func (rs RecordSecurity) MarshalJSON_Log_NoTimeNoHistory() ([]byte, error) + type RecordSecurityHistoryTime struct + Action RecordActionType + Event string + Time time.Time + User auser.RecordUserIdentity + type RecordSecurityHistoryTimes []*RecordSecurityHistoryTime + func (rsh *RecordSecurityHistoryTimes) AddEntry(user auser.RecordUserIdentity, action RecordActionType, event string, ...) + func (rsh RecordSecurityHistoryTimes) FilterByAction(action RecordActionType) RecordSecurityHistoryTimes + func (rsh RecordSecurityHistoryTimes) FindEntriesByUser(user auser.RecordUserIdentity) []*RecordSecurityHistoryTime + func (rsh RecordSecurityHistoryTimes) LatestEntry() *RecordSecurityHistoryTime + type SBAdapterSql struct + func NewSBAdapterSql(adapter IAdapterDB, db *sql.DB) *SBAdapterSql + func (sba *SBAdapterSql) GetHost() string + func (sba *SBAdapterSql) GetName() AdapterName + func (sba *SBAdapterSql) GetType() AdapterType + func (sba *SBAdapterSql) Query(query string) (ISBAdapterSqlRows, error) + func (sba *SBAdapterSql) QueryArgs(query string, args ...interface{}) (result ISBAdapterSqlRows, err error) + func (sba *SBAdapterSql) QueryModel(query string, model interface{}) error + func (sba *SBAdapterSql) QueryModelArgs(query string, model interface{}, args ...interface{}) error + func (sba *SBAdapterSql) SupportsModels() bool + type SBAdapterSqlRows struct + func (rows *SBAdapterSqlRows) Close() (err error) + func (rows *SBAdapterSqlRows) EndTimer() time.Duration + func (rows *SBAdapterSqlRows) GetTimerDuration() time.Duration + func (rows *SBAdapterSqlRows) Next() bool + func (rows *SBAdapterSqlRows) Scan(dest ...any) (err error) + func (rows *SBAdapterSqlRows) StartTimer() + type TestStatus string + const TESTSTATUS_FAILED + const TESTSTATUS_INITIALIZED + const TESTSTATUS_INITIALIZED_SUCCESSFUL