Documentation
¶
Overview ¶
Package graphmutation owns the in-repository graph mutation protocol identity. Application callers use narrow typed clients rather than subjects directly.
Index ¶
- Constants
- func IsCommitUnknown(err error) bool
- func IsDefinitelyNotCommitted(err error) bool
- func ResolveSubject(family string, operation Operation) (string, error)
- type Client
- func (c *Client) Append(ctx context.Context, request graph.AppendTriplesRequest) (*graph.AppendTriplesResponse, error)
- func (c *Client) Create(ctx context.Context, request graph.CreateEntityRequest) (*graph.CreateEntityResponse, error)
- func (c *Client) Delete(ctx context.Context, request graph.DeleteEntityRequest) (*graph.DeleteEntityResponse, error)
- func (c *Client) Reconcile(ctx context.Context, request graph.ReconcilePredicatesRequest) (*graph.ReconcilePredicatesResponse, error)
- type Operation
- type TransportError
- type TransportOutcome
Constants ¶
const ( // InterfaceType is the canonical component-port interface identity. InterfaceType = "semstreams.graph.mutation" // InterfaceVersion is the canonical component-port interface version. InterfaceVersion = "v1" // SubjectFamily is the only admitted NATS request/reply subject family. SubjectFamily = "graph.mutation.>" )
Variables ¶
This section is empty.
Functions ¶
func IsCommitUnknown ¶
IsCommitUnknown reports whether a mutation may have committed despite the missing or invalid reply.
func IsDefinitelyNotCommitted ¶
IsDefinitelyNotCommitted reports transport outcomes that prove no request was delivered: no responder, or a context already done before the call.
func ResolveSubject ¶
ResolveSubject returns the exact subject for an admitted operation within the canonical declared family. It rejects every other family and operation; callers cannot fall back to a port name or a literal subject table.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the single in-repository adapter for the canonical mutation port. Each method makes exactly one request. It never retries an ambiguous delivery.
func (*Client) Append ¶
func (c *Client) Append(ctx context.Context, request graph.AppendTriplesRequest) (*graph.AppendTriplesResponse, error)
Append appends triples independently per distinct subject.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, request graph.CreateEntityRequest) (*graph.CreateEntityResponse, error)
Create performs one atomic entity birth request.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, request graph.DeleteEntityRequest) (*graph.DeleteEntityResponse, error)
Delete conditionally deletes one entity at the supplied authority revision.
func (*Client) Reconcile ¶
func (c *Client) Reconcile( ctx context.Context, request graph.ReconcilePredicatesRequest, ) (*graph.ReconcilePredicatesResponse, error)
Reconcile makes one predicate set equal the supplied desired set.
type Operation ¶
type Operation string
Operation identifies one admitted graph mutation command.
const ( // CreateEntity strictly creates one entity and rejects an existing ID. CreateEntity Operation = "entity.create" // ReconcilePredicates replaces a declared predicate set under a revision fence. ReconcilePredicates Operation = "entity.reconcile" // AppendTriples adds set-valued triples to existing subjects. AppendTriples Operation = "triple.append" // DeleteEntity removes one entity under a revision fence. DeleteEntity Operation = "entity.delete" )
type TransportError ¶
type TransportError struct {
Operation Operation
Outcome TransportOutcome
Err error
}
TransportError is returned only for transport or invalid-reply failures. Classified handler failures remain their original typed error.
func (*TransportError) Error ¶
func (e *TransportError) Error() string
func (*TransportError) Unwrap ¶
func (e *TransportError) Unwrap() error
type TransportOutcome ¶
type TransportOutcome string
TransportOutcome describes what the requester can prove when no valid mutation reply exists. Only CommitUnknown permits that the command may have reached graph-ingest.
const ( TransportUnavailable TransportOutcome = "unavailable" // TransportDeadline proves the context ended before request delivery. TransportDeadline TransportOutcome = "deadline" // TransportCommitUnknown reports delivery without a valid mutation reply. TransportCommitUnknown TransportOutcome = "commit_unknown" )