Documentation
¶
Index ¶
- Constants
- func GetChatMetadata(intentRecord *ocp_intent.Record) *intentpb.ChatMetadata
- func GetContactDmPayment(intentRecord *ocp_intent.Record) *intentpb.ChatMetadata_ContactDmPayment
- func GetTipDmPayment(intentRecord *ocp_intent.Record) *intentpb.ChatMetadata_TipDmPayment
- func NewIntegration(accounts account.Store, profiles profile.Store) ocp_integration.SubmitIntent
- func NewSendContactDmPaymentMessageTask(intentRecord *ocp_intent.Record) *ocp_task.Record
- func NewSendTipDmPaymentMessageTask(intentRecord *ocp_intent.Record) *ocp_task.Record
- type Integration
- func (i *Integration) AllowCreation(ctx context.Context, intentRecord *ocp_intent.Record, ...) error
- func (i *Integration) GetTasksToSchedule(ctx context.Context, intentRecord *ocp_intent.Record) ([]*ocp_task.Record, error)
- func (i *Integration) OnSuccess(ctx context.Context, intentRecord *ocp_intent.Record) error
Constants ¶
const ( // TaskTypeSendContactDmPaymentMessage is the task that injects the cash // message into the sender and recipient's DM after a contact DM payment. TaskTypeSendContactDmPaymentMessage uint32 = 1 // TaskTypeSendTipDmPaymentMessage is the task that injects the cash message // into the sender and recipient's tip DM after a tip DM payment. TaskTypeSendTipDmPaymentMessage uint32 = 2 )
The OCP task system treats the type as an opaque app-owned namespace, so values must be globally unique across the app and stable forever — pending tasks in the DB reference them. Type 0 is reserved as invalid by the base system.
Variables ¶
This section is empty.
Functions ¶
func GetChatMetadata ¶ added in v1.15.0
func GetChatMetadata(intentRecord *ocp_intent.Record) *intentpb.ChatMetadata
GetChatMetadata extracts the chat metadata from the intent record's additional app metadata, if present. It returns nil when the intent carries no app metadata, the metadata fails to decode, or it is not chat metadata.
func GetContactDmPayment ¶ added in v1.15.0
func GetContactDmPayment(intentRecord *ocp_intent.Record) *intentpb.ChatMetadata_ContactDmPayment
GetContactDmPayment extracts the contact DM payment from the intent record's additional app metadata, if present. It returns nil when the intent carries no app metadata, the metadata fails to decode, or it is not a contact DM payment.
func GetTipDmPayment ¶ added in v1.23.0
func GetTipDmPayment(intentRecord *ocp_intent.Record) *intentpb.ChatMetadata_TipDmPayment
GetTipDmPayment extracts the tip DM payment from the intent record's additional app metadata, if present. It returns nil when the intent carries no app metadata, the metadata fails to decode, or it is not a tip DM payment.
func NewIntegration ¶
func NewIntegration( accounts account.Store, profiles profile.Store, ) ocp_integration.SubmitIntent
func NewSendContactDmPaymentMessageTask ¶ added in v1.15.0
func NewSendContactDmPaymentMessageTask(intentRecord *ocp_intent.Record) *ocp_task.Record
NewSendContactDmPaymentMessageTask creates the task that injects the cash message into the sender and recipient's DM after a contact DM payment. Only the intent ID is carried, via the reference ID; the executor reloads the authoritative intent record at execution time.
func NewSendTipDmPaymentMessageTask ¶ added in v1.23.0
func NewSendTipDmPaymentMessageTask(intentRecord *ocp_intent.Record) *ocp_task.Record
NewSendTipDmPaymentMessageTask creates the task that injects the cash message into the sender and recipient's tip DM after a tip DM payment. Only the intent ID is carried, via the reference ID; the executor reloads the authoritative intent record at execution time.
Types ¶
type Integration ¶
type Integration struct {
// contains filtered or unexported fields
}
func (*Integration) AllowCreation ¶
func (i *Integration) AllowCreation(ctx context.Context, intentRecord *ocp_intent.Record, metadata *ocp_transactionpb.Metadata, actions []*ocp_transactionpb.Action) error
func (*Integration) GetTasksToSchedule ¶ added in v1.15.0
func (i *Integration) GetTasksToSchedule(ctx context.Context, intentRecord *ocp_intent.Record) ([]*ocp_task.Record, error)
GetTasksToSchedule returns the guaranteed work derived from a submitted intent. A DM payment (contact or tip) schedules the cash message injected into the DM between the sender and recipient; execution is handled by task.Executor.
func (*Integration) OnSuccess ¶
func (i *Integration) OnSuccess(ctx context.Context, intentRecord *ocp_intent.Record) error