Documentation
¶
Overview ¶
Package durablepb contains the protobuf-generated wire types for journal.log entries.
To regenerate journal.pb.go after editing journal.proto:
go generate ./pb/
Prerequisites (one-time setup):
brew install protobuf go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
Commit both journal.proto and journal.pb.go in the same commit. Never edit journal.pb.go by hand.
Index ¶
- Variables
- type JournalEntry
- func (*JournalEntry) Descriptor() ([]byte, []int)deprecated
- func (m *JournalEntry) GetEntry() isJournalEntry_Entry
- func (x *JournalEntry) GetSignal() *SignalEntry
- func (x *JournalEntry) GetStep() *StepEntry
- func (*JournalEntry) ProtoMessage()
- func (x *JournalEntry) ProtoReflect() protoreflect.Message
- func (x *JournalEntry) Reset()
- func (x *JournalEntry) String() string
- type JournalEntry_Signal
- type JournalEntry_Step
- type SignalEntry
- func (*SignalEntry) Descriptor() ([]byte, []int)deprecated
- func (x *SignalEntry) GetPayload() []byte
- func (x *SignalEntry) GetSentAtNs() int64
- func (x *SignalEntry) GetSignalId() string
- func (*SignalEntry) ProtoMessage()
- func (x *SignalEntry) ProtoReflect() protoreflect.Message
- func (x *SignalEntry) Reset()
- func (x *SignalEntry) String() string
- type StepEntry
- func (*StepEntry) Descriptor() ([]byte, []int)deprecated
- func (x *StepEntry) GetCompletedAtNs() int64
- func (x *StepEntry) GetError() string
- func (x *StepEntry) GetInput() []byte
- func (x *StepEntry) GetPanicTrace() string
- func (x *StepEntry) GetResult() []byte
- func (x *StepEntry) GetStartedAtNs() int64
- func (x *StepEntry) GetStatus() StepStatus
- func (x *StepEntry) GetStepId() string
- func (x *StepEntry) GetVersion() string
- func (*StepEntry) ProtoMessage()
- func (x *StepEntry) ProtoReflect() protoreflect.Message
- func (x *StepEntry) Reset()
- func (x *StepEntry) String() string
- type StepStatus
Constants ¶
This section is empty.
Variables ¶
var ( StepStatus_name = map[int32]string{ 0: "STEP_STATUS_UNSPECIFIED", 1: "STEP_STATUS_WAITING", 2: "STEP_STATUS_COMPLETED", 3: "STEP_STATUS_FAILED", 4: "STEP_STATUS_RUNNING", } StepStatus_value = map[string]int32{ "STEP_STATUS_UNSPECIFIED": 0, "STEP_STATUS_WAITING": 1, "STEP_STATUS_COMPLETED": 2, "STEP_STATUS_FAILED": 3, "STEP_STATUS_RUNNING": 4, } )
Enum value maps for StepStatus.
var File_journal_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type JournalEntry ¶
type JournalEntry struct {
// Types that are assignable to Entry:
// *JournalEntry_Step
// *JournalEntry_Signal
Entry isJournalEntry_Entry `protobuf_oneof:"entry"`
// contains filtered or unexported fields
}
JournalEntry is the top-level frame written to journal.log. Using oneof keeps the format extensible for future entry types without field number conflicts.
func (*JournalEntry) Descriptor
deprecated
func (*JournalEntry) Descriptor() ([]byte, []int)
Deprecated: Use JournalEntry.ProtoReflect.Descriptor instead.
func (*JournalEntry) GetEntry ¶
func (m *JournalEntry) GetEntry() isJournalEntry_Entry
func (*JournalEntry) GetSignal ¶
func (x *JournalEntry) GetSignal() *SignalEntry
func (*JournalEntry) GetStep ¶
func (x *JournalEntry) GetStep() *StepEntry
func (*JournalEntry) ProtoMessage ¶
func (*JournalEntry) ProtoMessage()
func (*JournalEntry) ProtoReflect ¶
func (x *JournalEntry) ProtoReflect() protoreflect.Message
func (*JournalEntry) Reset ¶
func (x *JournalEntry) Reset()
func (*JournalEntry) String ¶
func (x *JournalEntry) String() string
type JournalEntry_Signal ¶
type JournalEntry_Signal struct {
Signal *SignalEntry `protobuf:"bytes,2,opt,name=signal,proto3,oneof"`
}
type JournalEntry_Step ¶
type JournalEntry_Step struct {
Step *StepEntry `protobuf:"bytes,1,opt,name=step,proto3,oneof"`
}
type SignalEntry ¶
type SignalEntry struct {
// signal_id is the step_id of the waiting step this payload completes.
SignalId string `protobuf:"bytes,1,opt,name=signal_id,json=signalId,proto3" json:"signal_id,omitempty"`
// payload is the JSON-encoded result delivered by CompleteStep.
Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
// sent_at_ns is Unix time in nanoseconds when CompleteStep was called.
SentAtNs int64 `protobuf:"varint,3,opt,name=sent_at_ns,json=sentAtNs,proto3" json:"sent_at_ns,omitempty"`
// contains filtered or unexported fields
}
SignalEntry records an external completion payload for a waiting step. Written by CompleteStep; consumed on resume when a WAITING step has a matching SignalEntry (signal_id == step_id).
Field-number contract (never reuse or renumber):
1 signal_id 2 payload 3 sent_at_ns
func (*SignalEntry) Descriptor
deprecated
func (*SignalEntry) Descriptor() ([]byte, []int)
Deprecated: Use SignalEntry.ProtoReflect.Descriptor instead.
func (*SignalEntry) GetPayload ¶
func (x *SignalEntry) GetPayload() []byte
func (*SignalEntry) GetSentAtNs ¶
func (x *SignalEntry) GetSentAtNs() int64
func (*SignalEntry) GetSignalId ¶
func (x *SignalEntry) GetSignalId() string
func (*SignalEntry) ProtoMessage ¶
func (*SignalEntry) ProtoMessage()
func (*SignalEntry) ProtoReflect ¶
func (x *SignalEntry) ProtoReflect() protoreflect.Message
func (*SignalEntry) Reset ¶
func (x *SignalEntry) Reset()
func (*SignalEntry) String ¶
func (x *SignalEntry) String() string
type StepEntry ¶
type StepEntry struct {
// step_id is the caller-supplied, run-scoped identifier (durable.StepRecord.StepID).
StepId string `protobuf:"bytes,1,opt,name=step_id,json=stepId,proto3" json:"step_id,omitempty"`
// status is the lifecycle state of this step.
Status StepStatus `protobuf:"varint,3,opt,name=status,proto3,enum=durablepb.StepStatus" json:"status,omitempty"`
// result is the JSON-marshalled output of a completed step.
// Empty for waiting/failed entries.
Result []byte `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"`
// error is the serialised error string for a failed step.
Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
// panic_trace holds the recovered panic value and stack (if the step panicked).
PanicTrace string `protobuf:"bytes,6,opt,name=panic_trace,json=panicTrace,proto3" json:"panic_trace,omitempty"`
// version is the WithStepVersion string for this checkpoint. Empty when
// the caller did not set a version.
Version string `protobuf:"bytes,7,opt,name=version,proto3" json:"version,omitempty"`
// started_at_ns is Unix time in nanoseconds when the step function was invoked.
StartedAtNs int64 `protobuf:"varint,8,opt,name=started_at_ns,json=startedAtNs,proto3" json:"started_at_ns,omitempty"`
// completed_at_ns is Unix time in nanoseconds when the step reached a terminal state.
// Zero for waiting entries that have not yet completed.
CompletedAtNs int64 `protobuf:"varint,9,opt,name=completed_at_ns,json=completedAtNs,proto3" json:"completed_at_ns,omitempty"`
// input is the JSON-marshalled step input (RunStep's in).
Input []byte `protobuf:"bytes,10,opt,name=input,proto3" json:"input,omitempty"`
// contains filtered or unexported fields
}
StepEntry is the binary wire format for a single step checkpoint written to journal.log. Using protobuf means:
- New fields can be added in future library versions with a new field number.
- Unknown fields are preserved on round-trip by the proto runtime.
- Old readers silently ignore fields they don't recognise (forward compatibility).
- Removing a field leaves the field number reserved, so old data still decodes (backward compatibility).
Field-number contract (never reuse or renumber):
1 step_id
2 reserved (was seq; removed in v0.1.3 — order is now the append
position in the journal itself, not a stored field)
3 status
4 result
5 error
6 panic_trace
7 version
8 started_at_ns
9 completed_at_ns
10 input
func (*StepEntry) Descriptor
deprecated
func (*StepEntry) GetCompletedAtNs ¶
func (*StepEntry) GetPanicTrace ¶
func (*StepEntry) GetStartedAtNs ¶
func (*StepEntry) GetStatus ¶
func (x *StepEntry) GetStatus() StepStatus
func (*StepEntry) GetVersion ¶ added in v0.1.4
func (*StepEntry) ProtoMessage ¶
func (*StepEntry) ProtoMessage()
func (*StepEntry) ProtoReflect ¶
func (x *StepEntry) ProtoReflect() protoreflect.Message
type StepStatus ¶
type StepStatus int32
StepStatus is the lifecycle state of a step checkpoint.
Enum value contract (never reuse or renumber):
0 STEP_STATUS_UNSPECIFIED — zero value / unknown
1 STEP_STATUS_WAITING — step suspended awaiting external signal or approval
2 STEP_STATUS_COMPLETED — step executed successfully; result is cached
3 STEP_STATUS_FAILED — step returned an error or panicked
4 STEP_STATUS_RUNNING — step function is executing (STARTED); watch-only,
never the latest record used for RunStep/GetStep replay
const ( StepStatus_STEP_STATUS_UNSPECIFIED StepStatus = 0 StepStatus_STEP_STATUS_WAITING StepStatus = 1 StepStatus_STEP_STATUS_COMPLETED StepStatus = 2 StepStatus_STEP_STATUS_FAILED StepStatus = 3 StepStatus_STEP_STATUS_RUNNING StepStatus = 4 )
func (StepStatus) Descriptor ¶
func (StepStatus) Descriptor() protoreflect.EnumDescriptor
func (StepStatus) Enum ¶
func (x StepStatus) Enum() *StepStatus
func (StepStatus) EnumDescriptor
deprecated
func (StepStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use StepStatus.Descriptor instead.
func (StepStatus) Number ¶
func (x StepStatus) Number() protoreflect.EnumNumber
func (StepStatus) String ¶
func (x StepStatus) String() string
func (StepStatus) Type ¶
func (StepStatus) Type() protoreflect.EnumType