Documentation
¶
Overview ¶
Package webhookstore owns ordinary declared outbound webhook endpoint, signing-secret and delivery records. The public outbound package owns every state transition, encryption and network effect.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Deliveries = orm.Define("foundry_webhook_deliveries", func(b orm.Builder[Delivery], m *Delivery) DeliveryTable { table := orm.TableOf(b, &m.ID) field0 := table.Key() field1 := orm.ColumnOf(b, &m.EndpointID) field2 := orm.TextOf(b, &m.Event) field3 := orm.TextOf(b, &m.Payload) field4 := orm.TextOf(b, &m.State) field5 := orm.NumberOf(b, &m.Attempts) field6 := orm.NumberOf(b, &m.LastStatus) field7 := orm.TextOf(b, &m.LastFailure) field8 := orm.CreatedAtOf(b, &m.CreatedAt) field9 := orm.UpdatedAtOf(b, &m.UpdatedAt) field10 := orm.NullableTimeOf(b, &m.DeliveredAt) return DeliveryTable{ Table: table, ID: field0, EndpointID: field1, Event: field2, Payload: field3, State: field4, Attempts: field5, LastStatus: field6, LastFailure: field7, CreatedAt: field8, UpdatedAt: field9, DeliveredAt: field10, } }, orm.ModelFingerprint("fc3418e2c15ac890ca9906312f7470a7e24d164d090a05ddf585048ff9a829dc"))
Deliveries is the foundry_webhook_deliveries table.
var Endpoints = orm.Define("foundry_webhook_endpoints", func(b orm.Builder[Endpoint], m *Endpoint) EndpointTable { table := orm.TableOf(b, &m.ID) field0 := table.Key() field1 := orm.TextOf(b, &m.URL) field2 := orm.JSONOf(b, &m.Events) field3 := orm.ColumnOf(b, &m.Active) field4 := orm.CreatedAtOf(b, &m.CreatedAt) field5 := orm.UpdatedAtOf(b, &m.UpdatedAt) return EndpointTable{ Table: table, ID: field0, URL: field1, Events: field2, Active: field3, CreatedAt: field4, UpdatedAt: field5, } }, orm.ModelFingerprint("4cc4862f4cb2cef2194dcc3267344e7efb4f0b17553111a332b7f246f48700ec"))
Endpoints is the foundry_webhook_endpoints table.
var Secrets = orm.Define("foundry_webhook_secrets", func(b orm.Builder[Secret], m *Secret) SecretTable { table := orm.TableOf(b, &m.ID) field0 := table.Key() field1 := orm.ColumnOf(b, &m.EndpointID) field2 := orm.TextOf(b, &m.Ciphertext) field3 := orm.NullableTimeOf(b, &m.ExpiresAt) field4 := orm.TimeOf(b, &m.CreatedAt) return SecretTable{ Table: table, ID: field0, EndpointID: field1, Ciphertext: field2, ExpiresAt: field3, CreatedAt: field4, } }, orm.ModelFingerprint("ed515c90872cfa8ca0900be6dfa11a9a2962bf8ea2d66d6aa02bd787b3a3a9c2"))
Secrets is the foundry_webhook_secrets table.
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery struct {
// Table provides model queries and writes. Example: orm.First(ctx, tx, Deliveries.Query()).
//
// ID binds Delivery.ID.
// Example: orm.Set(Deliveries.ID, id).
ID model.ID[Delivery] `foundry:"member=ID"`
// EndpointID binds Delivery.EndpointID.
// Example: orm.Set(Deliveries.EndpointID, endpointID).
EndpointID model.ID[Endpoint] `foundry:"role=column"`
// Event binds Delivery.Event.
// Example: orm.Set(Deliveries.Event, event).
Event string
// Payload binds Delivery.Payload.
// Example: orm.Set(Deliveries.Payload, payload).
Payload string
// State binds Delivery.State.
// Example: orm.Set(Deliveries.State, state).
State string
// Attempts binds Delivery.Attempts.
// Example: orm.Set(Deliveries.Attempts, attempts).
Attempts uint32
// LastStatus binds Delivery.LastStatus.
// Example: orm.Set(Deliveries.LastStatus, lastStatus).
LastStatus int32
// LastFailure binds Delivery.LastFailure.
// Example: orm.Set(Deliveries.LastFailure, lastFailure).
LastFailure string
// CreatedAt preserves explicit input; persistence supplies the owning clock when omitted.
//
// CreatedAt preserves an explicit creation time; the owning clock supplies omitted values.
// Example: orm.Set(Deliveries.CreatedAt, createdAt).
CreatedAt temporal.DateTime `foundry:"role=created-at"`
// UpdatedAt is refreshed from the owning clock after before-write hooks and before mutators.
//
// UpdatedAt is replaced by the owning clock after before-write hooks and before mutators.
// Example: orm.Set(Deliveries.UpdatedAt, updatedAt).
UpdatedAt temporal.DateTime `foundry:"role=updated-at"`
// DeliveredAt binds Delivery.DeliveredAt.
// Example: orm.SetNull(Deliveries.DeliveredAt).
DeliveredAt value.Nullable[temporal.DateTime]
}
Delivery is the delivery log and durable payload of one message. Its ID is the stable webhook-id across attempts and replays.
type DeliveryTable ¶
type DeliveryTable struct {
//
// Table provides model queries and writes. Example: orm.First(ctx, tx, Deliveries.Query()).
//
// ID binds Delivery.ID.
// Example: orm.Set(Deliveries.ID, id).
//
// See [Delivery.ID].
orm.Table[Delivery, model.ID[Delivery]]
//
// Table provides model queries and writes. Example: orm.First(ctx, tx, Deliveries.Query()).
//
// ID binds Delivery.ID.
// Example: orm.Set(Deliveries.ID, id).
//
// See [Delivery.ID].
ID orm.Key[Delivery, model.ID[Delivery]]
//
// EndpointID binds Delivery.EndpointID.
// Example: orm.Set(Deliveries.EndpointID, endpointID).
//
// See [Delivery.EndpointID].
EndpointID orm.Column[Delivery, model.ID[Endpoint]]
//
// Event binds Delivery.Event.
// Example: orm.Set(Deliveries.Event, event).
//
// See [Delivery.Event].
Event orm.Text[Delivery, string]
//
// Payload binds Delivery.Payload.
// Example: orm.Set(Deliveries.Payload, payload).
//
// See [Delivery.Payload].
Payload orm.Text[Delivery, string]
//
// State binds Delivery.State.
// Example: orm.Set(Deliveries.State, state).
//
// See [Delivery.State].
State orm.Text[Delivery, string]
//
// Attempts binds Delivery.Attempts.
// Example: orm.Set(Deliveries.Attempts, attempts).
//
// See [Delivery.Attempts].
Attempts orm.Number[Delivery, uint32]
//
// LastStatus binds Delivery.LastStatus.
// Example: orm.Set(Deliveries.LastStatus, lastStatus).
//
// See [Delivery.LastStatus].
LastStatus orm.Number[Delivery, int32]
//
// LastFailure binds Delivery.LastFailure.
// Example: orm.Set(Deliveries.LastFailure, lastFailure).
//
// See [Delivery.LastFailure].
LastFailure orm.Text[Delivery, string]
//
// CreatedAt preserves explicit input; persistence supplies the owning clock when omitted.
//
// CreatedAt preserves an explicit creation time; the owning clock supplies omitted values.
// Example: orm.Set(Deliveries.CreatedAt, createdAt).
//
// See [Delivery.CreatedAt].
CreatedAt orm.CreatedAt[Delivery, temporal.DateTime]
//
// UpdatedAt is refreshed from the owning clock after before-write hooks and before mutators.
//
// UpdatedAt is replaced by the owning clock after before-write hooks and before mutators.
// Example: orm.Set(Deliveries.UpdatedAt, updatedAt).
//
// See [Delivery.UpdatedAt].
UpdatedAt orm.UpdatedAt[Delivery, temporal.DateTime]
//
// DeliveredAt binds Delivery.DeliveredAt.
// Example: orm.SetNull(Deliveries.DeliveredAt).
//
// See [Delivery.DeliveredAt].
DeliveredAt orm.NullableTime[Delivery, temporal.DateTime]
}
DeliveryTable binds the declared fields of Delivery.
type Endpoint ¶
type Endpoint struct {
// Table provides model queries and writes. Example: orm.First(ctx, tx, Endpoints.Query()).
//
// ID binds Endpoint.ID.
// Example: orm.Set(Endpoints.ID, id).
ID model.ID[Endpoint] `foundry:"member=ID"`
// URL binds Endpoint.URL.
// Example: orm.Set(Endpoints.URL, url).
URL string
// Events binds Endpoint.Events.
// Example: encoded, err := value.NewJSON(events); if err == nil { _ = orm.Set(Endpoints.Events, encoded) }.
Events value.JSON[[]string]
// Active binds Endpoint.Active.
// Example: orm.Set(Endpoints.Active, active).
Active bool `foundry:"role=column"`
// CreatedAt preserves explicit input; persistence supplies the owning clock when omitted.
//
// CreatedAt preserves an explicit creation time; the owning clock supplies omitted values.
// Example: orm.Set(Endpoints.CreatedAt, createdAt).
CreatedAt temporal.DateTime `foundry:"role=created-at"`
// UpdatedAt is refreshed from the owning clock after before-write hooks and before mutators.
//
// UpdatedAt is replaced by the owning clock after before-write hooks and before mutators.
// Example: orm.Set(Endpoints.UpdatedAt, updatedAt).
UpdatedAt temporal.DateTime `foundry:"role=updated-at"`
}
type EndpointTable ¶
type EndpointTable struct {
//
// Table provides model queries and writes. Example: orm.First(ctx, tx, Endpoints.Query()).
//
// ID binds Endpoint.ID.
// Example: orm.Set(Endpoints.ID, id).
//
// See [Endpoint.ID].
orm.Table[Endpoint, model.ID[Endpoint]]
//
// Table provides model queries and writes. Example: orm.First(ctx, tx, Endpoints.Query()).
//
// ID binds Endpoint.ID.
// Example: orm.Set(Endpoints.ID, id).
//
// See [Endpoint.ID].
ID orm.Key[Endpoint, model.ID[Endpoint]]
//
// URL binds Endpoint.URL.
// Example: orm.Set(Endpoints.URL, url).
//
// See [Endpoint.URL].
URL orm.Text[Endpoint, string]
//
// Events binds Endpoint.Events.
// Example: encoded, err := value.NewJSON(events); if err == nil { _ = orm.Set(Endpoints.Events, encoded) }.
//
// See [Endpoint.Events].
Events orm.JSON[Endpoint, []string]
//
// Active binds Endpoint.Active.
// Example: orm.Set(Endpoints.Active, active).
//
// See [Endpoint.Active].
Active orm.Column[Endpoint, bool]
//
// CreatedAt preserves explicit input; persistence supplies the owning clock when omitted.
//
// CreatedAt preserves an explicit creation time; the owning clock supplies omitted values.
// Example: orm.Set(Endpoints.CreatedAt, createdAt).
//
// See [Endpoint.CreatedAt].
CreatedAt orm.CreatedAt[Endpoint, temporal.DateTime]
//
// UpdatedAt is refreshed from the owning clock after before-write hooks and before mutators.
//
// UpdatedAt is replaced by the owning clock after before-write hooks and before mutators.
// Example: orm.Set(Endpoints.UpdatedAt, updatedAt).
//
// See [Endpoint.UpdatedAt].
UpdatedAt orm.UpdatedAt[Endpoint, temporal.DateTime]
}
EndpointTable binds the declared fields of Endpoint.
type Secret ¶
type Secret struct {
// Table provides model queries and writes. Example: orm.First(ctx, tx, Secrets.Query()).
//
// ID binds Secret.ID.
// Example: orm.Set(Secrets.ID, id).
ID model.ID[Secret] `foundry:"member=ID"`
// EndpointID binds Secret.EndpointID.
// Example: orm.Set(Secrets.EndpointID, endpointID).
EndpointID model.ID[Endpoint] `foundry:"role=column"`
// Ciphertext binds Secret.Ciphertext.
// Example: orm.Set(Secrets.Ciphertext, ciphertext).
Ciphertext string
// ExpiresAt binds Secret.ExpiresAt.
// Example: orm.SetNull(Secrets.ExpiresAt).
ExpiresAt value.Nullable[temporal.DateTime]
// CreatedAt preserves an explicit creation time; callers supply this timestamp.
// Example: orm.Set(Secrets.CreatedAt, createdAt).
CreatedAt temporal.DateTime `foundry:"role=time"`
}
Secret stores one encrypted signing secret. A null ExpiresAt marks the current secret; a rotated secret keeps signing until it expires.
type SecretTable ¶
type SecretTable struct {
//
// Table provides model queries and writes. Example: orm.First(ctx, tx, Secrets.Query()).
//
// ID binds Secret.ID.
// Example: orm.Set(Secrets.ID, id).
//
// See [Secret.ID].
orm.Table[Secret, model.ID[Secret]]
//
// Table provides model queries and writes. Example: orm.First(ctx, tx, Secrets.Query()).
//
// ID binds Secret.ID.
// Example: orm.Set(Secrets.ID, id).
//
// See [Secret.ID].
ID orm.Key[Secret, model.ID[Secret]]
//
// EndpointID binds Secret.EndpointID.
// Example: orm.Set(Secrets.EndpointID, endpointID).
//
// See [Secret.EndpointID].
EndpointID orm.Column[Secret, model.ID[Endpoint]]
//
// Ciphertext binds Secret.Ciphertext.
// Example: orm.Set(Secrets.Ciphertext, ciphertext).
//
// See [Secret.Ciphertext].
Ciphertext orm.Text[Secret, string]
//
// ExpiresAt binds Secret.ExpiresAt.
// Example: orm.SetNull(Secrets.ExpiresAt).
//
// See [Secret.ExpiresAt].
ExpiresAt orm.NullableTime[Secret, temporal.DateTime]
//
// CreatedAt preserves an explicit creation time; callers supply this timestamp.
// Example: orm.Set(Secrets.CreatedAt, createdAt).
//
// See [Secret.CreatedAt].
CreatedAt orm.Time[Secret, temporal.DateTime]
}
SecretTable binds the declared fields of Secret.