Documentation
¶
Index ¶
- Constants
- Variables
- type Browser
- type BrowserExplainLine
- type BrowserExplainNode
- type BrowserExplainResult
- type BrowserExplainRow
- type BrowserExplainTable
- type BrowserItem
- type BrowserQueryResult
- type Driver
- type DriverAuditColumn
- type DriverAuditLock
- type DriverAuditLog
- type DriverConnection
- type DriverExecutionContext
- type DriverInstance
- type DriverQuery
- type DriverQueryResult
Constants ¶
View Source
const ( EditorTypeString = "string" EditorTypeFloat64 = "float64" EditorTypeInt64 = "int64" EditorTypeUint64 = "uint64" EditorTypeObject = "object" )
View Source
const ( DriverAuditLogTableName = "_ferro_audit_log" DriverAuditLockTableName = "_ferro_audit_lock" DriverAuditLockIDForMigrations = "migrataion" )
View Source
const ( DriverAuditColumnString int = iota + 1 DriverAuditColumnInt64 DriverAuditColumnTime DriverAuditColumnJSON )
Variables ¶
View Source
var ( // audit log columns DriverAuditColumnID = DriverAuditColumn{PrimaryKey: true, Name: "id", Type: DriverAuditColumnInt64, Nullable: false} DriverAuditColumnAppliedAt = DriverAuditColumn{PrimaryKey: false, Name: "applied_at", Type: DriverAuditColumnTime, Nullable: false} DriverAuditColumnEvent = DriverAuditColumn{PrimaryKey: false, Name: "event", Type: DriverAuditColumnString, Nullable: false} DriverAuditColumnData = DriverAuditColumn{PrimaryKey: false, Name: "data", Type: DriverAuditColumnJSON, Nullable: false} DriverAuditColumnMetadata = DriverAuditColumn{PrimaryKey: false, Name: "metadata", Type: DriverAuditColumnJSON, Nullable: true} // lock columns DriverAuditLockColumnID = DriverAuditColumn{PrimaryKey: true, Name: "id", Type: DriverAuditColumnString, Nullable: false} DriverAuditLockColumnLockedAt = DriverAuditColumn{PrimaryKey: false, Name: "locked_at", Type: DriverAuditColumnTime, Nullable: false} DriverAuditLockColumnLockedBy = DriverAuditColumn{PrimaryKey: false, Name: "locked_by", Type: DriverAuditColumnString, Nullable: false} DriverAuditLockColumnData = DriverAuditColumn{PrimaryKey: false, Name: "data", Type: DriverAuditColumnJSON, Nullable: false} ErrAuditAlreadyLocked = fmt.Errorf("audit log is already locked") )
Functions ¶
This section is empty.
Types ¶
type Browser ¶
type Browser interface {
Connect(ctx context.Context, dsn string) error
Disconnect(ctx context.Context) error
List(ctx context.Context, ids []string) ([]BrowserItem, error)
Show(ctx context.Context, ids []string) (string, error)
Query(ctx context.Context, sql string) (BrowserQueryResult, error)
ParseExplain(data BrowserQueryResult) (BrowserExplainResult, error)
}
type BrowserExplainLine ¶
type BrowserExplainNode ¶
type BrowserExplainNode struct {
Name string
Lines []BrowserExplainLine
Children []BrowserExplainNode
}
type BrowserExplainResult ¶
type BrowserExplainResult struct {
Root BrowserExplainNode
SummaryLines []BrowserExplainLine
Tables []BrowserExplainTable
}
type BrowserExplainRow ¶
type BrowserExplainTable ¶
type BrowserExplainTable struct {
Title string
Headers []string
Rows []BrowserExplainRow
}
type BrowserItem ¶
type BrowserQueryResult ¶
type Driver ¶
type Driver interface {
Connect(ctx context.Context, config config.DriverConfig) (DriverConnection, error)
Disconnect(ctx context.Context, conn DriverConnection) error
}
type DriverAuditColumn ¶
type DriverAuditLock ¶
type DriverAuditLog ¶
type DriverAuditLog struct {
ID int64
AppliedAt time.Time
Event string
Data map[string]any
Metadata map[string]any
}
func (*DriverAuditLog) GetData ¶
func (d *DriverAuditLog) GetData(key string) string
func (*DriverAuditLog) GetMetadata ¶
func (d *DriverAuditLog) GetMetadata(key string) string
type DriverConnection ¶
type DriverConnection interface {
UpsertAuditLogTable(ctx context.Context, execCtx DriverExecutionContext) error
UpsertAuditLockTable(ctx context.Context, execCtx DriverExecutionContext) error
LockAuditLog(ctx context.Context, execCtx DriverExecutionContext, lock DriverAuditLock) error
UnlockAuditLog(ctx context.Context, execCtx DriverExecutionContext, lock DriverAuditLock) error
AppendAuditLog(ctx context.Context, execCtx DriverExecutionContext, log DriverAuditLog) error
ReadAuditLogs(ctx context.Context, execCtx DriverExecutionContext) ([]DriverAuditLog, error)
Query(execCtx DriverExecutionContext) DriverQuery
}
type DriverExecutionContext ¶
type DriverInstance ¶
type DriverQuery ¶
type DriverQueryResult ¶
Click to show internal directories.
Click to hide internal directories.