Skip to content

Commit cf12908

Browse files
committed
more private
1 parent 2679e55 commit cf12908

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

dbos/dbos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ func NewDBOSContext(ctx context.Context, inputConfig Config) (DBOSContext, error
373373
// Initialize global variables from processed config (already handles env vars and defaults)
374374
initExecutor.applicationVersion = config.ApplicationVersion
375375
initExecutor.executorID = config.ExecutorID
376-
initExecutor.serializer = NewGobSerializer()
376+
initExecutor.serializer = newGobSerializer()
377377

378378
initExecutor.applicationID = os.Getenv("DBOS__APPID")
379379

dbos/serialization.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type serializer interface {
1919
}
2020

2121
func isGobSerializer(s serializer) bool {
22-
_, ok := s.(*GobSerializer)
22+
_, ok := s.(*gobSerializer)
2323
return ok
2424
}
2525

@@ -51,20 +51,20 @@ func safeGobRegister(value any) {
5151
gob.Register(value)
5252
}
5353

54-
// init registers the gobValue wrapper type with gob for GobSerializer
54+
// init registers the gobValue wrapper type with gob for gobSerializer
5555
func init() {
5656
// Register wrapper type - this is required for gob encoding/decoding to work
5757
safeGobRegister(gobValue{})
5858
}
5959

60-
// GobSerializer implements serializer using encoding/gob
61-
type GobSerializer struct{}
60+
// gobSerializer implements serializer using encoding/gob
61+
type gobSerializer struct{}
6262

63-
func NewGobSerializer() *GobSerializer {
64-
return &GobSerializer{}
63+
func newGobSerializer() *gobSerializer {
64+
return &gobSerializer{}
6565
}
6666

67-
func (g *GobSerializer) Encode(data any) (string, error) {
67+
func (g *gobSerializer) Encode(data any) (string, error) {
6868
// Check if data is nil (for pointer types, slice, map, interface, chan, func)
6969
if isNilValue(data) {
7070
// For nil values, encode an empty byte slice directly to base64
@@ -83,7 +83,7 @@ func (g *GobSerializer) Encode(data any) (string, error) {
8383
return base64.StdEncoding.EncodeToString(buf.Bytes()), nil
8484
}
8585

86-
func (g *GobSerializer) Decode(data *string) (any, error) {
86+
func (g *gobSerializer) Decode(data *string) (any, error) {
8787
if data == nil || *data == "" {
8888
return nil, nil
8989
}
@@ -119,7 +119,7 @@ func deserialize[T any](serializer serializer, encoded *string) (T, error) {
119119
return zero, nil
120120
}
121121

122-
// For GobSerializer, register type T before decoding
122+
// For gobSerializer, register type T before decoding
123123
// This is required on the recovery path, where the process might not have been doing the encode/registering.
124124
if isGobSerializer(serializer) {
125125
// Check if T is an interface type - if so, skip registration

dbos/serialization_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ func serializerRecoveryWorkflow(ctx DBOSContext, input TestWorkflowData) (TestWo
583583
}, WithStepName("BlockingStep"))
584584
}
585585

586-
// init registers all custom types with gob for GobSerializer
586+
// init registers all custom types with gob for gobSerializer
587587
// Note: gob requires concrete types to be registered. Interface types cannot be registered
588588
// directly - only their concrete implementations. When encoding interface{} fields,
589589
// gob needs the concrete type to be registered.

0 commit comments

Comments
 (0)