Documentation
¶
Index ¶
- func ApplyHandlerSideEffects(ctx context.Context, exec *Executor, result map[string]interface{})
- func ExecuteCrons(ctx context.Context, schema *ast.Schema, db *sql.DB) error
- func ExecuteSeeds(ctx context.Context, schema *ast.Schema, exec *Executor) error
- func ExecuteSetups(ctx context.Context, schema *ast.Schema, exec *Executor) error
- func FindCronEntry(schema *ast.Schema, name string) *ast.CronEntry
- func RootRequestIDFromCtx(ctx context.Context) string
- func WithSystemBody(body map[string]interface{}) map[string]interface{}
- func WithSystemInput(body map[string]interface{}) map[string]interface{}
- type CachedResult
- type ConnectionResult
- type EdgeResult
- type EventBus
- type EventEmitter
- type Executor
- func (e *Executor) Avg(ctx context.Context, modelName, field string, req map[string]interface{}) (result float64, err error)
- func (e *Executor) Count(ctx context.Context, modelName string, req map[string]interface{}) (result float64, err error)
- func (e *Executor) Create(ctx context.Context, modelName string, req map[string]interface{}) (out map[string]interface{}, err error)
- func (e *Executor) DB() *sql.DB
- func (e *Executor) Delete(ctx context.Context, modelName string, id string, req map[string]interface{}) (err error)
- func (e *Executor) DeleteMany(ctx context.Context, modelName string, req map[string]interface{}) (n int64, err error)
- func (e *Executor) ExecuteCronBody(ctx context.Context, entry *ast.CronEntry) error
- func (e *Executor) ExecuteEffectActions(ctx context.Context, stmts []ast.Statement, input map[string]interface{}, ...) error
- func (e *Executor) ExternalManager() *ExternalManager
- func (e *Executor) InputKeyForDBColumn(modelName, dbColumn string) (string, error)
- func (e *Executor) Max(ctx context.Context, modelName, field string, req map[string]interface{}) (result float64, err error)
- func (e *Executor) Min(ctx context.Context, modelName, field string, req map[string]interface{}) (result float64, err error)
- func (e *Executor) Read(ctx context.Context, modelName string, req map[string]interface{}) (result []map[string]interface{}, err error)
- func (e *Executor) ReadConnection(ctx context.Context, modelName string, req map[string]interface{}) (*ConnectionResult, error)
- func (e *Executor) RegisterRoomName(name, id string)
- func (e *Executor) Restore(ctx context.Context, modelName string, id string, req map[string]interface{}) (err error)
- func (e *Executor) Schema() *ast.Schema
- func (e *Executor) SetEventBus(bus EventBus)
- func (e *Executor) SetLogSink(s LogSink)
- func (e *Executor) SetOutboxNotify(fn func(id string))
- func (e *Executor) SetRoomBus(b *events.RoomBus)
- func (e *Executor) Stddev(ctx context.Context, modelName, field string, req map[string]interface{}) (result float64, err error)
- func (e *Executor) Sum(ctx context.Context, modelName, field string, req map[string]interface{}) (result float64, err error)
- func (e *Executor) Update(ctx context.Context, modelName string, id string, req map[string]interface{}) (out map[string]interface{}, err error)
- func (e *Executor) UpdateMany(ctx context.Context, modelName string, req map[string]interface{}) (n int64, err error)
- func (e *Executor) Variance(ctx context.Context, modelName, field string, req map[string]interface{}) (result float64, err error)
- type ExternalHandler
- type ExternalManager
- func (em *ExternalManager) Call(ctx context.Context, name string, input map[string]interface{}) (map[string]interface{}, error)
- func (em *ExternalManager) Register(name string, handler ExternalHandler)
- func (em *ExternalManager) RegisterURL(name, baseURL string)
- func (em *ExternalManager) SetRoomBus(b *events.RoomBus)
- type IdemResult
- type IdempotencyStore
- type JSONSink
- type LogEntry
- type LogSink
- type Logger
- type LoggerWrapper
- type OutboxProcessor
- func (op *OutboxProcessor) NotifyNewOutboxItem(id string)
- func (op *OutboxProcessor) PurgeFailedBefore(ctx context.Context, before time.Time) (int64, error)
- func (op *OutboxProcessor) RetryFailed(ctx context.Context, id string) error
- func (op *OutboxProcessor) Start(interval time.Duration)
- func (op *OutboxProcessor) Stop()
- type PageInfoResult
- type PrettySink
- type ReadStore
- type Store
- type StoreAdapter
- func (s *StoreAdapter) Create(ctx context.Context, model string, body map[string]interface{}) (map[string]interface{}, error)
- func (s *StoreAdapter) Delete(ctx context.Context, model string, id string) error
- func (s *StoreAdapter) Read(ctx context.Context, model string, args map[string]interface{}) ([]map[string]interface{}, error)
- func (s *StoreAdapter) Update(ctx context.Context, model string, id string, patch map[string]interface{}) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyHandlerSideEffects ¶
func ExecuteSeeds ¶
func ExecuteSetups ¶
func RootRequestIDFromCtx ¶
func WithSystemBody ¶
func WithSystemInput ¶
Types ¶
type CachedResult ¶
type ConnectionResult ¶
type ConnectionResult struct {
Edges []EdgeResult
PageInfo PageInfoResult
TotalCount int
}
type EdgeResult ¶
type EventEmitter ¶
type EventEmitter struct {
// contains filtered or unexported fields
}
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func (*Executor) DeleteMany ¶
func (*Executor) ExecuteCronBody ¶
func (*Executor) ExecuteEffectActions ¶
func (*Executor) ExternalManager ¶
func (e *Executor) ExternalManager() *ExternalManager
func (*Executor) InputKeyForDBColumn ¶
func (*Executor) ReadConnection ¶
func (*Executor) RegisterRoomName ¶
func (*Executor) SetEventBus ¶
func (*Executor) SetLogSink ¶
func (*Executor) SetOutboxNotify ¶
func (*Executor) SetRoomBus ¶
func (*Executor) UpdateMany ¶
type ExternalHandler ¶
type ExternalManager ¶
type ExternalManager struct {
// contains filtered or unexported fields
}
func NewExternalManager ¶
func NewExternalManager() *ExternalManager
func (*ExternalManager) Register ¶
func (em *ExternalManager) Register(name string, handler ExternalHandler)
func (*ExternalManager) RegisterURL ¶
func (em *ExternalManager) RegisterURL(name, baseURL string)
func (*ExternalManager) SetRoomBus ¶
func (em *ExternalManager) SetRoomBus(b *events.RoomBus)
type IdemResult ¶
type IdempotencyStore ¶
type IdempotencyStore struct {
// contains filtered or unexported fields
}
func NewIdempotencyStore ¶
func NewIdempotencyStore(db *sql.DB) *IdempotencyStore
func (*IdempotencyStore) Begin ¶
func (s *IdempotencyStore) Begin(ctx context.Context, key string) (*IdemResult, error)
func (*IdempotencyStore) Commit ¶
func (s *IdempotencyStore) Commit(ctx context.Context, key string, result interface{}) error
func (*IdempotencyStore) CreateTable ¶
func (s *IdempotencyStore) CreateTable(ctx context.Context) error
type LogEntry ¶
type LogEntry struct {
Timestamp time.Time `json:"ts"`
Level string `json:"level"`
RootRequestID string `json:"root_request_id"`
TraceID string `json:"trace_id,omitempty"`
SpanID string `json:"span_id,omitempty"`
Operation string `json:"operation,omitempty"`
Model string `json:"model,omitempty"`
Block string `json:"block,omitempty"`
Depth int `json:"depth"`
LineNo int `json:"line_no,omitempty"`
Message string `json:"msg"`
Fields map[string]interface{} `json:"fields,omitempty"`
Source string `json:"source"`
}
type Logger ¶
type Logger interface {
Info(msg string, args ...interface{})
Warn(msg string, args ...interface{})
Error(msg string, args ...interface{})
}
func NewLoggerWrapper ¶
type LoggerWrapper ¶
func (*LoggerWrapper) Error ¶
func (l *LoggerWrapper) Error(msg string, args ...interface{})
func (*LoggerWrapper) Info ¶
func (l *LoggerWrapper) Info(msg string, args ...interface{})
Info logs a message with optional structured key-value pairs. Caller convention: Info("msg", "key1", val1, "key2", val2, ...) NOT printf-style — there are no format verbs in the message.
func (*LoggerWrapper) Warn ¶
func (l *LoggerWrapper) Warn(msg string, args ...interface{})
type OutboxProcessor ¶
type OutboxProcessor struct {
// contains filtered or unexported fields
}
func NewOutboxProcessor ¶
func NewOutboxProcessor(exec *Executor) *OutboxProcessor
func NewOutboxProcessorWithRedis ¶
func NewOutboxProcessorWithRedis(exec *Executor, rdb *redis.Client) *OutboxProcessor
func (*OutboxProcessor) NotifyNewOutboxItem ¶
func (op *OutboxProcessor) NotifyNewOutboxItem(id string)
func (*OutboxProcessor) PurgeFailedBefore ¶
func (*OutboxProcessor) RetryFailed ¶
func (op *OutboxProcessor) RetryFailed(ctx context.Context, id string) error
func (*OutboxProcessor) Start ¶
func (op *OutboxProcessor) Start(interval time.Duration)
func (*OutboxProcessor) Stop ¶
func (op *OutboxProcessor) Stop()
type PageInfoResult ¶
type PrettySink ¶
type PrettySink struct {
// contains filtered or unexported fields
}
func (*PrettySink) Emit ¶
func (s *PrettySink) Emit(e LogEntry)
type Store ¶
type Store interface {
Read(ctx context.Context, model string, args map[string]interface{}) ([]map[string]interface{}, error)
Create(ctx context.Context, model string, body map[string]interface{}) (map[string]interface{}, error)
Update(ctx context.Context, model string, id string, patch map[string]interface{}) (map[string]interface{}, error)
Delete(ctx context.Context, model string, id string) error
}
Click to show internal directories.
Click to hide internal directories.