Documentation
¶
Index ¶
- type Context
- func (c *Context) Begin(ctx context.Context) error
- func (c *Context) Commit(ctx context.Context) error
- func (c *Context) DeleteEnvironment(ctx context.Context, envID, workspaceID idwrap.IDWrap) error
- func (c *Context) DeleteFile(ctx context.Context, file FileDeleteItem) error
- func (c *Context) DeleteFileBatch(ctx context.Context, items []FileDeleteItem) error
- func (c *Context) DeleteFlow(ctx context.Context, item FlowDeleteItem) error
- func (c *Context) DeleteFlowBatch(ctx context.Context, items []FlowDeleteItem) error
- func (c *Context) DeleteGraphQL(ctx context.Context, item GraphQLDeleteItem) error
- func (c *Context) DeleteGraphQLBatch(ctx context.Context, items []GraphQLDeleteItem) error
- func (c *Context) DeleteHTTP(ctx context.Context, item HTTPDeleteItem) error
- func (c *Context) DeleteHTTPBatch(ctx context.Context, items []HTTPDeleteItem) error
- func (c *Context) DeleteWorkspace(ctx context.Context, workspaceID idwrap.IDWrap) error
- func (c *Context) Events() []Event
- func (c *Context) InsertCredential(ctx context.Context, item CredentialInsertItem) error
- func (c *Context) InsertCredentialBatch(ctx context.Context, items []CredentialInsertItem) error
- func (c *Context) InsertGraphQL(ctx context.Context, item GraphQLInsertItem) error
- func (c *Context) InsertGraphQLAssert(ctx context.Context, item GraphQLAssertInsertItem) error
- func (c *Context) InsertGraphQLAssertBatch(ctx context.Context, items []GraphQLAssertInsertItem) error
- func (c *Context) InsertGraphQLBatch(ctx context.Context, items []GraphQLInsertItem) error
- func (c *Context) InsertHTTP(ctx context.Context, item HTTPInsertItem) error
- func (c *Context) InsertHTTPAssert(ctx context.Context, item HTTPAssertInsertItem) error
- func (c *Context) InsertHTTPAssertBatch(ctx context.Context, items []HTTPAssertInsertItem) error
- func (c *Context) InsertHTTPBatch(ctx context.Context, items []HTTPInsertItem) error
- func (c *Context) InsertHTTPBodyForm(ctx context.Context, item HTTPBodyFormInsertItem) error
- func (c *Context) InsertHTTPBodyFormBatch(ctx context.Context, items []HTTPBodyFormInsertItem) error
- func (c *Context) InsertHTTPBodyRaw(ctx context.Context, item HTTPBodyRawInsertItem) error
- func (c *Context) InsertHTTPBodyRawBatch(ctx context.Context, items []HTTPBodyRawInsertItem) error
- func (c *Context) InsertHTTPBodyUrlEncoded(ctx context.Context, item HTTPBodyUrlEncodedInsertItem) error
- func (c *Context) InsertHTTPBodyUrlEncodedBatch(ctx context.Context, items []HTTPBodyUrlEncodedInsertItem) error
- func (c *Context) InsertHTTPHeader(ctx context.Context, item HTTPHeaderInsertItem) error
- func (c *Context) InsertHTTPHeaderBatch(ctx context.Context, items []HTTPHeaderInsertItem) error
- func (c *Context) InsertHTTPSearchParam(ctx context.Context, item HTTPSearchParamInsertItem) error
- func (c *Context) InsertHTTPSearchParamBatch(ctx context.Context, items []HTTPSearchParamInsertItem) error
- func (c *Context) IsTxFree() bool
- func (c *Context) Publish()
- func (c *Context) Queries() *gen.Queries
- func (c *Context) Reset()
- func (c *Context) Rollback()
- func (c *Context) TX() *sql.Tx
- func (c *Context) Track(evt Event)
- func (c *Context) UpdateGraphQL(ctx context.Context, item GraphQLUpdateItem) error
- func (c *Context) UpdateGraphQLAssert(ctx context.Context, item GraphQLAssertUpdateItem) error
- func (c *Context) UpdateGraphQLAssertBatch(ctx context.Context, items []GraphQLAssertUpdateItem) error
- func (c *Context) UpdateGraphQLAssertDelta(ctx context.Context, item GraphQLAssertDeltaUpdateItem) error
- func (c *Context) UpdateGraphQLAssertDeltaBatch(ctx context.Context, items []GraphQLAssertDeltaUpdateItem) error
- func (c *Context) UpdateGraphQLBatch(ctx context.Context, items []GraphQLUpdateItem) error
- func (c *Context) UpdateHTTP(ctx context.Context, item HTTPUpdateItem) (*HTTPUpdateResult, error)
- func (c *Context) UpdateHTTPAssert(ctx context.Context, item HTTPAssertUpdateItem) error
- func (c *Context) UpdateHTTPAssertBatch(ctx context.Context, items []HTTPAssertUpdateItem) error
- func (c *Context) UpdateHTTPAssertDelta(ctx context.Context, item HTTPAssertDeltaUpdateItem) error
- func (c *Context) UpdateHTTPAssertDeltaBatch(ctx context.Context, items []HTTPAssertDeltaUpdateItem) error
- func (c *Context) UpdateHTTPBatch(ctx context.Context, items []HTTPUpdateItem) ([]HTTPUpdateResult, error)
- func (c *Context) UpdateHTTPBodyForm(ctx context.Context, item HTTPBodyFormUpdateItem) error
- func (c *Context) UpdateHTTPBodyFormBatch(ctx context.Context, items []HTTPBodyFormUpdateItem) error
- func (c *Context) UpdateHTTPBodyFormDelta(ctx context.Context, item HTTPBodyFormDeltaUpdateItem) error
- func (c *Context) UpdateHTTPBodyFormDeltaBatch(ctx context.Context, items []HTTPBodyFormDeltaUpdateItem) error
- func (c *Context) UpdateHTTPBodyRaw(ctx context.Context, item HTTPBodyRawUpdateItem) error
- func (c *Context) UpdateHTTPBodyRawBatch(ctx context.Context, items []HTTPBodyRawUpdateItem) error
- func (c *Context) UpdateHTTPBodyRawDelta(ctx context.Context, item HTTPBodyRawDeltaUpdateItem) error
- func (c *Context) UpdateHTTPBodyRawDeltaBatch(ctx context.Context, items []HTTPBodyRawDeltaUpdateItem) error
- func (c *Context) UpdateHTTPBodyUrlEncoded(ctx context.Context, item HTTPBodyUrlEncodedUpdateItem) error
- func (c *Context) UpdateHTTPBodyUrlEncodedBatch(ctx context.Context, items []HTTPBodyUrlEncodedUpdateItem) error
- func (c *Context) UpdateHTTPBodyUrlEncodedDelta(ctx context.Context, item HTTPBodyUrlEncodedDeltaUpdateItem) error
- func (c *Context) UpdateHTTPBodyUrlEncodedDeltaBatch(ctx context.Context, items []HTTPBodyUrlEncodedDeltaUpdateItem) error
- func (c *Context) UpdateHTTPHeader(ctx context.Context, item HTTPHeaderUpdateItem) error
- func (c *Context) UpdateHTTPHeaderBatch(ctx context.Context, items []HTTPHeaderUpdateItem) error
- func (c *Context) UpdateHTTPHeaderDelta(ctx context.Context, item HTTPHeaderDeltaUpdateItem) error
- func (c *Context) UpdateHTTPHeaderDeltaBatch(ctx context.Context, items []HTTPHeaderDeltaUpdateItem) error
- func (c *Context) UpdateHTTPSearchParam(ctx context.Context, item HTTPSearchParamUpdateItem) error
- func (c *Context) UpdateHTTPSearchParamBatch(ctx context.Context, items []HTTPSearchParamUpdateItem) error
- func (c *Context) UpdateHTTPSearchParamDelta(ctx context.Context, item HTTPSearchParamDeltaUpdateItem) error
- func (c *Context) UpdateHTTPSearchParamDeltaBatch(ctx context.Context, items []HTTPSearchParamDeltaUpdateItem) error
- func (c *Context) UpdateLastEventPayload(payload any)
- type CredentialInsertItem
- type EntityType
- type Event
- type FileDeleteItem
- type FlowDeleteItem
- type GraphQLAssertDeltaUpdateItem
- type GraphQLAssertInsertItem
- type GraphQLAssertUpdateItem
- type GraphQLDeleteItem
- type GraphQLInsertItem
- type GraphQLUpdateItem
- type HTTPAssertDeltaUpdateItem
- type HTTPAssertInsertItem
- type HTTPAssertUpdateItem
- type HTTPBodyFormDeltaUpdateItem
- type HTTPBodyFormInsertItem
- type HTTPBodyFormUpdateItem
- type HTTPBodyRawDeltaUpdateItem
- type HTTPBodyRawInsertItem
- type HTTPBodyRawUpdateItem
- type HTTPBodyUrlEncodedDeltaUpdateItem
- type HTTPBodyUrlEncodedInsertItem
- type HTTPBodyUrlEncodedUpdateItem
- type HTTPDeleteItem
- type HTTPHeaderDeltaUpdateItem
- type HTTPHeaderInsertItem
- type HTTPHeaderUpdateItem
- type HTTPInsertItem
- type HTTPSearchParamDeltaUpdateItem
- type HTTPSearchParamInsertItem
- type HTTPSearchParamUpdateItem
- type HTTPUpdateItem
- type HTTPUpdateResult
- type MultiPublisher
- type Operation
- type Option
- type Publisher
- type Recorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context manages a mutation transaction with automatic cascade event collection. Events are collected during mutations and can be retrieved after commit for publishing. Use WithoutTX() option to skip transaction creation for publish-only mode.
func (*Context) Commit ¶
Commit commits the transaction and records events for replay (dev only). If a publisher is configured, events are auto-published after successful commit. If WithoutTX() was used, this just publishes events without DB commit. Otherwise, call Events() to get collected events for manual publishing.
func (*Context) DeleteEnvironment ¶
DeleteEnvironment deletes an environment and collects cascade events for all variables.
func (*Context) DeleteFile ¶
func (c *Context) DeleteFile(ctx context.Context, file FileDeleteItem) error
DeleteFile deletes a file and the content it points to (HTTP/Flow). File -> points to -> Content, so deleting file cascades DOWN to content. This is the PUBLIC entry point for content deletion.
func (*Context) DeleteFileBatch ¶
func (c *Context) DeleteFileBatch(ctx context.Context, items []FileDeleteItem) error
DeleteFileBatch deletes multiple files and their content.
func (*Context) DeleteFlow ¶
func (c *Context) DeleteFlow(ctx context.Context, item FlowDeleteItem) error
DeleteFlow deletes a flow, handling File ownership. If Flow has a File owner, deletion goes through File (which cascades back to Flow). If Flow is orphaned (no File), it's deleted directly. This is the PUBLIC API - safe to call from RPC handlers.
func (*Context) DeleteFlowBatch ¶
func (c *Context) DeleteFlowBatch(ctx context.Context, items []FlowDeleteItem) error
DeleteFlowBatch deletes multiple flows, handling File ownership. Groups items by whether they have File owners for efficient processing.
func (*Context) DeleteGraphQL ¶
func (c *Context) DeleteGraphQL(ctx context.Context, item GraphQLDeleteItem) error
DeleteGraphQL deletes a GraphQL entry and tracks cascade events.
func (*Context) DeleteGraphQLBatch ¶
func (c *Context) DeleteGraphQLBatch(ctx context.Context, items []GraphQLDeleteItem) error
DeleteGraphQLBatch deletes multiple GraphQL entries.
func (*Context) DeleteHTTP ¶
func (c *Context) DeleteHTTP(ctx context.Context, item HTTPDeleteItem) error
DeleteHTTP deletes an HTTP entry, handling File ownership. If HTTP has a File owner, deletion goes through File (which cascades back to HTTP). If HTTP is orphaned (no File), it's deleted directly. This is the PUBLIC API - safe to call from RPC handlers.
func (*Context) DeleteHTTPBatch ¶
func (c *Context) DeleteHTTPBatch(ctx context.Context, items []HTTPDeleteItem) error
DeleteHTTPBatch deletes multiple HTTP entries, handling File ownership. Groups items by whether they have File owners for efficient processing.
func (*Context) DeleteWorkspace ¶
DeleteWorkspace deletes a workspace and collects cascade events for all children. This is a deep cascade - collects events for HTTP children, Flow children, etc. Files have FK to workspace so DB CASCADE handles them.
func (*Context) Events ¶
Events returns all collected events for publishing. Call this after Commit() to get events to publish.
func (*Context) InsertCredential ¶
func (c *Context) InsertCredential(ctx context.Context, item CredentialInsertItem) error
InsertCredential inserts a credential and tracks the event.
func (*Context) InsertCredentialBatch ¶
func (c *Context) InsertCredentialBatch(ctx context.Context, items []CredentialInsertItem) error
InsertCredentialBatch inserts multiple credentials.
func (*Context) InsertGraphQL ¶
func (c *Context) InsertGraphQL(ctx context.Context, item GraphQLInsertItem) error
InsertGraphQL inserts a GraphQL entry and tracks the event.
func (*Context) InsertGraphQLAssert ¶
func (c *Context) InsertGraphQLAssert(ctx context.Context, item GraphQLAssertInsertItem) error
InsertGraphQLAssert inserts a GraphQL assert and tracks the event.
func (*Context) InsertGraphQLAssertBatch ¶
func (c *Context) InsertGraphQLAssertBatch(ctx context.Context, items []GraphQLAssertInsertItem) error
InsertGraphQLAssertBatch inserts multiple GraphQL asserts.
func (*Context) InsertGraphQLBatch ¶
func (c *Context) InsertGraphQLBatch(ctx context.Context, items []GraphQLInsertItem) error
InsertGraphQLBatch inserts multiple GraphQL entries.
func (*Context) InsertHTTP ¶
func (c *Context) InsertHTTP(ctx context.Context, item HTTPInsertItem) error
InsertHTTP inserts an HTTP entry and tracks the event.
func (*Context) InsertHTTPAssert ¶
func (c *Context) InsertHTTPAssert(ctx context.Context, item HTTPAssertInsertItem) error
InsertHTTPAssert inserts an HTTP assert and tracks the event.
func (*Context) InsertHTTPAssertBatch ¶
func (c *Context) InsertHTTPAssertBatch(ctx context.Context, items []HTTPAssertInsertItem) error
InsertHTTPAssertBatch inserts multiple HTTP asserts.
func (*Context) InsertHTTPBatch ¶
func (c *Context) InsertHTTPBatch(ctx context.Context, items []HTTPInsertItem) error
InsertHTTPBatch inserts multiple HTTP entries.
func (*Context) InsertHTTPBodyForm ¶
func (c *Context) InsertHTTPBodyForm(ctx context.Context, item HTTPBodyFormInsertItem) error
InsertHTTPBodyForm inserts an HTTP body form and tracks the event.
func (*Context) InsertHTTPBodyFormBatch ¶
func (c *Context) InsertHTTPBodyFormBatch(ctx context.Context, items []HTTPBodyFormInsertItem) error
InsertHTTPBodyFormBatch inserts multiple HTTP body forms.
func (*Context) InsertHTTPBodyRaw ¶
func (c *Context) InsertHTTPBodyRaw(ctx context.Context, item HTTPBodyRawInsertItem) error
InsertHTTPBodyRaw inserts an HTTP body raw and tracks the event.
func (*Context) InsertHTTPBodyRawBatch ¶
func (c *Context) InsertHTTPBodyRawBatch(ctx context.Context, items []HTTPBodyRawInsertItem) error
InsertHTTPBodyRawBatch inserts multiple HTTP body raw items.
func (*Context) InsertHTTPBodyUrlEncoded ¶
func (c *Context) InsertHTTPBodyUrlEncoded(ctx context.Context, item HTTPBodyUrlEncodedInsertItem) error
InsertHTTPBodyUrlEncoded inserts an HTTP body URL encoded and tracks the event.
func (*Context) InsertHTTPBodyUrlEncodedBatch ¶
func (c *Context) InsertHTTPBodyUrlEncodedBatch(ctx context.Context, items []HTTPBodyUrlEncodedInsertItem) error
InsertHTTPBodyUrlEncodedBatch inserts multiple HTTP body URL encoded items.
func (*Context) InsertHTTPHeader ¶
func (c *Context) InsertHTTPHeader(ctx context.Context, item HTTPHeaderInsertItem) error
InsertHTTPHeader inserts an HTTP header and tracks the event.
func (*Context) InsertHTTPHeaderBatch ¶
func (c *Context) InsertHTTPHeaderBatch(ctx context.Context, items []HTTPHeaderInsertItem) error
InsertHTTPHeaderBatch inserts multiple HTTP headers.
func (*Context) InsertHTTPSearchParam ¶
func (c *Context) InsertHTTPSearchParam(ctx context.Context, item HTTPSearchParamInsertItem) error
InsertHTTPSearchParam inserts an HTTP search param and tracks the event.
func (*Context) InsertHTTPSearchParamBatch ¶
func (c *Context) InsertHTTPSearchParamBatch(ctx context.Context, items []HTTPSearchParamInsertItem) error
InsertHTTPSearchParamBatch inserts multiple HTTP search params.
func (*Context) Publish ¶
func (c *Context) Publish()
Publish immediately publishes all tracked events without commit. Useful in TX-free mode for explicit publish timing.
func (*Context) Queries ¶
Queries returns the sqlc queries bound to the transaction. Returns nil in TX-free mode.
func (*Context) Rollback ¶
func (c *Context) Rollback()
Rollback aborts the transaction. If WithoutTX() was used, this just clears collected events.
func (*Context) Track ¶
Track adds an event to the collection (public API for leaf entities). Use this for entities without cascade children (headers, params, etc.).
func (*Context) UpdateGraphQL ¶
func (c *Context) UpdateGraphQL(ctx context.Context, item GraphQLUpdateItem) error
UpdateGraphQL updates a GraphQL entry and tracks the event.
func (*Context) UpdateGraphQLAssert ¶
func (c *Context) UpdateGraphQLAssert(ctx context.Context, item GraphQLAssertUpdateItem) error
UpdateGraphQLAssert updates a GraphQL assert and tracks the event.
func (*Context) UpdateGraphQLAssertBatch ¶
func (c *Context) UpdateGraphQLAssertBatch(ctx context.Context, items []GraphQLAssertUpdateItem) error
UpdateGraphQLAssertBatch updates multiple GraphQL asserts.
func (*Context) UpdateGraphQLAssertDelta ¶
func (c *Context) UpdateGraphQLAssertDelta(ctx context.Context, item GraphQLAssertDeltaUpdateItem) error
UpdateGraphQLAssertDelta updates a GraphQL assert delta and tracks the event.
func (*Context) UpdateGraphQLAssertDeltaBatch ¶
func (c *Context) UpdateGraphQLAssertDeltaBatch(ctx context.Context, items []GraphQLAssertDeltaUpdateItem) error
UpdateGraphQLAssertDeltaBatch updates multiple GraphQL assert deltas.
func (*Context) UpdateGraphQLBatch ¶
func (c *Context) UpdateGraphQLBatch(ctx context.Context, items []GraphQLUpdateItem) error
UpdateGraphQLBatch updates multiple GraphQL entries.
func (*Context) UpdateHTTP ¶
func (c *Context) UpdateHTTP(ctx context.Context, item HTTPUpdateItem) (*HTTPUpdateResult, error)
UpdateHTTP updates an HTTP entry, tracking events. Versions are only created by HttpRun, which includes full snapshot data.
func (*Context) UpdateHTTPAssert ¶
func (c *Context) UpdateHTTPAssert(ctx context.Context, item HTTPAssertUpdateItem) error
UpdateHTTPAssert updates an HTTP assert and tracks the event.
func (*Context) UpdateHTTPAssertBatch ¶
func (c *Context) UpdateHTTPAssertBatch(ctx context.Context, items []HTTPAssertUpdateItem) error
UpdateHTTPAssertBatch updates multiple HTTP asserts.
func (*Context) UpdateHTTPAssertDelta ¶
func (c *Context) UpdateHTTPAssertDelta(ctx context.Context, item HTTPAssertDeltaUpdateItem) error
UpdateHTTPAssertDelta updates an HTTP assert delta and tracks the event.
func (*Context) UpdateHTTPAssertDeltaBatch ¶
func (c *Context) UpdateHTTPAssertDeltaBatch(ctx context.Context, items []HTTPAssertDeltaUpdateItem) error
UpdateHTTPAssertDeltaBatch updates multiple HTTP assert deltas.
func (*Context) UpdateHTTPBatch ¶
func (c *Context) UpdateHTTPBatch(ctx context.Context, items []HTTPUpdateItem) ([]HTTPUpdateResult, error)
UpdateHTTPBatch updates multiple HTTP entries.
func (*Context) UpdateHTTPBodyForm ¶
func (c *Context) UpdateHTTPBodyForm(ctx context.Context, item HTTPBodyFormUpdateItem) error
UpdateHTTPBodyForm updates an HTTP body form and tracks the event.
func (*Context) UpdateHTTPBodyFormBatch ¶
func (c *Context) UpdateHTTPBodyFormBatch(ctx context.Context, items []HTTPBodyFormUpdateItem) error
UpdateHTTPBodyFormBatch updates multiple HTTP body forms.
func (*Context) UpdateHTTPBodyFormDelta ¶
func (c *Context) UpdateHTTPBodyFormDelta(ctx context.Context, item HTTPBodyFormDeltaUpdateItem) error
UpdateHTTPBodyFormDelta updates an HTTP body form delta and tracks the event.
func (*Context) UpdateHTTPBodyFormDeltaBatch ¶
func (c *Context) UpdateHTTPBodyFormDeltaBatch(ctx context.Context, items []HTTPBodyFormDeltaUpdateItem) error
UpdateHTTPBodyFormDeltaBatch updates multiple HTTP body form deltas.
func (*Context) UpdateHTTPBodyRaw ¶
func (c *Context) UpdateHTTPBodyRaw(ctx context.Context, item HTTPBodyRawUpdateItem) error
UpdateHTTPBodyRaw updates an HTTP body raw and tracks the event.
func (*Context) UpdateHTTPBodyRawBatch ¶
func (c *Context) UpdateHTTPBodyRawBatch(ctx context.Context, items []HTTPBodyRawUpdateItem) error
UpdateHTTPBodyRawBatch updates multiple HTTP body raw items.
func (*Context) UpdateHTTPBodyRawDelta ¶
func (c *Context) UpdateHTTPBodyRawDelta(ctx context.Context, item HTTPBodyRawDeltaUpdateItem) error
UpdateHTTPBodyRawDelta updates an HTTP body raw delta and tracks the event.
func (*Context) UpdateHTTPBodyRawDeltaBatch ¶
func (c *Context) UpdateHTTPBodyRawDeltaBatch(ctx context.Context, items []HTTPBodyRawDeltaUpdateItem) error
UpdateHTTPBodyRawDeltaBatch updates multiple HTTP body raw deltas.
func (*Context) UpdateHTTPBodyUrlEncoded ¶
func (c *Context) UpdateHTTPBodyUrlEncoded(ctx context.Context, item HTTPBodyUrlEncodedUpdateItem) error
UpdateHTTPBodyUrlEncoded updates an HTTP body URL encoded and tracks the event.
func (*Context) UpdateHTTPBodyUrlEncodedBatch ¶
func (c *Context) UpdateHTTPBodyUrlEncodedBatch(ctx context.Context, items []HTTPBodyUrlEncodedUpdateItem) error
UpdateHTTPBodyUrlEncodedBatch updates multiple HTTP body URL encoded items.
func (*Context) UpdateHTTPBodyUrlEncodedDelta ¶
func (c *Context) UpdateHTTPBodyUrlEncodedDelta(ctx context.Context, item HTTPBodyUrlEncodedDeltaUpdateItem) error
UpdateHTTPBodyUrlEncodedDelta updates an HTTP body URL encoded delta and tracks the event.
func (*Context) UpdateHTTPBodyUrlEncodedDeltaBatch ¶
func (c *Context) UpdateHTTPBodyUrlEncodedDeltaBatch(ctx context.Context, items []HTTPBodyUrlEncodedDeltaUpdateItem) error
UpdateHTTPBodyUrlEncodedDeltaBatch updates multiple HTTP body URL encoded deltas.
func (*Context) UpdateHTTPHeader ¶
func (c *Context) UpdateHTTPHeader(ctx context.Context, item HTTPHeaderUpdateItem) error
UpdateHTTPHeader updates an HTTP header and tracks the event.
func (*Context) UpdateHTTPHeaderBatch ¶
func (c *Context) UpdateHTTPHeaderBatch(ctx context.Context, items []HTTPHeaderUpdateItem) error
UpdateHTTPHeaderBatch updates multiple HTTP headers.
func (*Context) UpdateHTTPHeaderDelta ¶
func (c *Context) UpdateHTTPHeaderDelta(ctx context.Context, item HTTPHeaderDeltaUpdateItem) error
UpdateHTTPHeaderDelta updates an HTTP header delta and tracks the event.
func (*Context) UpdateHTTPHeaderDeltaBatch ¶
func (c *Context) UpdateHTTPHeaderDeltaBatch(ctx context.Context, items []HTTPHeaderDeltaUpdateItem) error
UpdateHTTPHeaderDeltaBatch updates multiple HTTP header deltas.
func (*Context) UpdateHTTPSearchParam ¶
func (c *Context) UpdateHTTPSearchParam(ctx context.Context, item HTTPSearchParamUpdateItem) error
UpdateHTTPSearchParam updates an HTTP search param and tracks the event.
func (*Context) UpdateHTTPSearchParamBatch ¶
func (c *Context) UpdateHTTPSearchParamBatch(ctx context.Context, items []HTTPSearchParamUpdateItem) error
UpdateHTTPSearchParamBatch updates multiple HTTP search params.
func (*Context) UpdateHTTPSearchParamDelta ¶
func (c *Context) UpdateHTTPSearchParamDelta(ctx context.Context, item HTTPSearchParamDeltaUpdateItem) error
UpdateHTTPSearchParamDelta updates an HTTP search param delta and tracks the event.
func (*Context) UpdateHTTPSearchParamDeltaBatch ¶
func (c *Context) UpdateHTTPSearchParamDeltaBatch(ctx context.Context, items []HTTPSearchParamDeltaUpdateItem) error
UpdateHTTPSearchParamDeltaBatch updates multiple HTTP search param deltas.
func (*Context) UpdateLastEventPayload ¶
UpdateLastEventPayload updates the payload of the most recently tracked event.
type CredentialInsertItem ¶
type CredentialInsertItem struct {
Credential *mcredential.Credential
WorkspaceID idwrap.IDWrap
}
CredentialInsertItem represents a credential to insert.
type EntityType ¶
type EntityType uint16
EntityType identifies the type of entity being mutated. Using uint16 for compact storage and no string comparisons at runtime.
const ( // Workspace entities EntityWorkspace EntityType = iota EntityWorkspaceUser EntityEnvironment EntityEnvironmentValue EntityTag // HTTP entities EntityHTTP EntityHTTPHeader EntityHTTPParam EntityHTTPBodyForm EntityHTTPBodyURL EntityHTTPBodyRaw EntityHTTPAssert EntityHTTPResponse EntityHTTPResponseHeader EntityHTTPResponseAssert EntityHTTPVersion // Flow entities EntityFlow EntityFlowNode EntityFlowNodeHTTP EntityFlowNodeFor EntityFlowNodeForEach EntityFlowNodeCondition EntityFlowNodeJS EntityFlowNodeAI EntityFlowNodeAiProvider EntityFlowNodeMemory EntityFlowNodeGraphQL EntityFlowNodeWsConnection EntityFlowNodeWsSend EntityFlowNodeWait EntityFlowNodeSubFlowTrigger EntityFlowNodeSubFlowReturn EntityFlowNodeRunSubFlow EntityFlowEdge EntityFlowVariable EntityFlowTag // File system EntityFile // Credential entities EntityCredential // GraphQL entities EntityGraphQL EntityGraphQLHeader EntityGraphQLAssert EntityGraphQLResponse EntityGraphQLResponseHeader EntityGraphQLResponseAssert )
type Event ¶
type Event struct {
Entity EntityType
Op Operation
ID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
ParentID idwrap.IDWrap // For child entities - the parent ID (e.g., FlowID for nodes/edges/variables)
IsDelta bool
Payload any // For insert/update - the entity data
Patch any // For update - the changed fields
}
Event represents a single mutation event. Events are collected during a mutation transaction and published on commit.
type FileDeleteItem ¶
type FileDeleteItem struct {
ID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
ContentID *idwrap.IDWrap
ContentKind mfile.ContentType
}
FileDeleteItem represents a file to delete with its context.
type FlowDeleteItem ¶
FlowDeleteItem represents a flow to delete with its context.
type GraphQLAssertDeltaUpdateItem ¶
type GraphQLAssertDeltaUpdateItem struct {
ID idwrap.IDWrap
GraphQLID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
Params gen.UpdateGraphQLAssertDeltaParams
Patch any
Payload any
}
GraphQLAssertDeltaUpdateItem represents a GraphQL assert delta to update.
type GraphQLAssertInsertItem ¶
type GraphQLAssertInsertItem struct {
ID idwrap.IDWrap
GraphQLID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.CreateGraphQLAssertParams
}
GraphQLAssertInsertItem represents a GraphQL assert to insert.
type GraphQLAssertUpdateItem ¶
type GraphQLAssertUpdateItem struct {
ID idwrap.IDWrap
GraphQLID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.UpdateGraphQLAssertParams
Patch patch.GraphQLAssertPatch
}
GraphQLAssertUpdateItem represents a GraphQL assert to update.
type GraphQLDeleteItem ¶
GraphQLDeleteItem represents a GraphQL entry to delete.
type GraphQLInsertItem ¶
GraphQLInsertItem represents a GraphQL entry to insert.
type GraphQLUpdateItem ¶
GraphQLUpdateItem represents a GraphQL entry to update.
type HTTPAssertDeltaUpdateItem ¶
type HTTPAssertDeltaUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
Params gen.UpdateHTTPAssertDeltaParams
Patch any
Payload any
}
HTTPAssertDeltaUpdateItem represents an HTTP assert delta to update.
type HTTPAssertInsertItem ¶
type HTTPAssertInsertItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.CreateHTTPAssertParams
}
HTTPAssertInsertItem represents an HTTP assert to insert.
type HTTPAssertUpdateItem ¶
type HTTPAssertUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.UpdateHTTPAssertParams
Patch any
Payload any
}
HTTPAssertUpdateItem represents an HTTP assert to update.
type HTTPBodyFormDeltaUpdateItem ¶
type HTTPBodyFormDeltaUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
Params gen.UpdateHTTPBodyFormDeltaParams
Patch any
Payload any
}
HTTPBodyFormDeltaUpdateItem represents an HTTP body form delta to update.
type HTTPBodyFormInsertItem ¶
type HTTPBodyFormInsertItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.CreateHTTPBodyFormParams
}
HTTPBodyFormInsertItem represents an HTTP body form to insert.
type HTTPBodyFormUpdateItem ¶
type HTTPBodyFormUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.UpdateHTTPBodyFormParams
Patch any
Payload any
}
HTTPBodyFormUpdateItem represents an HTTP body form to update.
type HTTPBodyRawDeltaUpdateItem ¶
type HTTPBodyRawDeltaUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
Params gen.UpdateHTTPBodyRawDeltaParams
Patch any
Payload any
}
HTTPBodyRawDeltaUpdateItem represents an HTTP body raw delta to update.
type HTTPBodyRawInsertItem ¶
type HTTPBodyRawInsertItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.CreateHTTPBodyRawParams
}
HTTPBodyRawInsertItem represents an HTTP body raw to insert.
type HTTPBodyRawUpdateItem ¶
type HTTPBodyRawUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.UpdateHTTPBodyRawParams
Patch any
Payload any
}
HTTPBodyRawUpdateItem represents an HTTP body raw to update.
type HTTPBodyUrlEncodedDeltaUpdateItem ¶
type HTTPBodyUrlEncodedDeltaUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
Params gen.UpdateHTTPBodyUrlEncodedDeltaParams
Patch any
Payload any
}
HTTPBodyUrlEncodedDeltaUpdateItem represents an HTTP body URL encoded delta to update.
type HTTPBodyUrlEncodedInsertItem ¶
type HTTPBodyUrlEncodedInsertItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.CreateHTTPBodyUrlEncodedParams
}
HTTPBodyUrlEncodedInsertItem represents an HTTP body URL encoded to insert.
type HTTPBodyUrlEncodedUpdateItem ¶
type HTTPBodyUrlEncodedUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.UpdateHTTPBodyUrlEncodedParams
Patch any
Payload any
}
HTTPBodyUrlEncodedUpdateItem represents an HTTP body URL encoded to update.
type HTTPDeleteItem ¶
HTTPDeleteItem represents an HTTP entry to delete with its context.
type HTTPHeaderDeltaUpdateItem ¶
type HTTPHeaderDeltaUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
Params gen.UpdateHTTPHeaderDeltaParams
Patch any
Payload any
}
HTTPHeaderDeltaUpdateItem represents an HTTP header delta to update.
type HTTPHeaderInsertItem ¶
type HTTPHeaderInsertItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.CreateHTTPHeaderParams
}
HTTPHeaderInsertItem represents an HTTP header to insert.
type HTTPHeaderUpdateItem ¶
type HTTPHeaderUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.UpdateHTTPHeaderParams
Patch any
Payload any
}
HTTPHeaderUpdateItem represents an HTTP header to update.
type HTTPInsertItem ¶
type HTTPInsertItem struct {
HTTP *mhttp.HTTP // The HTTP model to insert
WorkspaceID idwrap.IDWrap // For event routing
IsDelta bool // Whether this is a delta HTTP
}
HTTPInsertItem represents an HTTP entry to insert.
type HTTPSearchParamDeltaUpdateItem ¶
type HTTPSearchParamDeltaUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
Params gen.UpdateHTTPSearchParamDeltaParams
Patch any
Payload any
}
HTTPSearchParamDeltaUpdateItem represents an HTTP search param delta to update.
type HTTPSearchParamInsertItem ¶
type HTTPSearchParamInsertItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.CreateHTTPSearchParamParams
}
HTTPSearchParamInsertItem represents an HTTP search param to insert.
type HTTPSearchParamUpdateItem ¶
type HTTPSearchParamUpdateItem struct {
ID idwrap.IDWrap
HttpID idwrap.IDWrap
WorkspaceID idwrap.IDWrap
IsDelta bool
Params gen.UpdateHTTPSearchParamParams
Patch any
Payload any
}
HTTPSearchParamUpdateItem represents an HTTP search param to update.
type HTTPUpdateItem ¶
type HTTPUpdateItem struct {
HTTP *mhttp.HTTP // The HTTP model with updated fields
WorkspaceID idwrap.IDWrap // For event routing
IsDelta bool // Whether this is a delta update
Patch any // The patch object for sync (e.g., patch.HTTPDeltaPatch)
UserID idwrap.IDWrap // Kept for compatibility
}
HTTPUpdateItem represents an HTTP entry to update with its context.
type HTTPUpdateResult ¶
HTTPUpdateResult contains the result of an HTTP update.
type MultiPublisher ¶
type MultiPublisher []Publisher
MultiPublisher fans an event slice out to several publishers in order. Each underlying publisher's switch typically ignores entity types it doesn't handle, so combining domain-specific publishers (flow + http + graphql, …) just works without a central dispatch table.
func (MultiPublisher) PublishAll ¶
func (m MultiPublisher) PublishAll(events []Event)
PublishAll forwards events to every publisher in the slice.
type Option ¶
type Option func(*Context)
Option configures a Context.
func WithPublisher ¶
WithPublisher sets the publisher for auto-publishing events after commit.
type Publisher ¶
type Publisher interface {
// PublishAll publishes all events after a successful commit.
// Called automatically by Context.Commit() if a publisher is configured.
PublishAll(events []Event)
}
Publisher handles automatic event publishing after commit. Implementations route events to the appropriate streamers based on entity type.